Bug 70559

Summary: shared-mime-info-1.2: fdatasync needs writable file descriptor
Product: shared-mime-info Reporter: Thomas Klausner <tk>
Component: generalAssignee: Shared Mime Info group <shared_mime_info>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: highest CC: walters
Version: unspecified   
Hardware: All   
OS: NetBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch fixing the described issues.

Description Thomas Klausner 2013-10-17 04:35:51 UTC
Created attachment 87770 [details] [review]
Patch fixing the described issues.

shared-mime-info-1.2's update-mime-database tries to use fdatasync on a file descriptor open for reading only, which always fails on NetBSD.

The fdatasync man page for NetBSD says in the ERRORS section:

     [EBADF]            The fd argument is not a valid file descriptor open
                        for writing.

The attached patch fixes this, please commit it soon, because otherwise update-mime-database does not work at all on NetBSD.
Comment 1 Colin Walters 2013-10-19 16:07:35 UTC
Looks correct to me, sorry about the bug!
Comment 2 Bastien Nocera 2013-10-19 16:15:47 UTC
commit 41f1d5ff2672c30d7f86759e2398b75c88673516
Author: Thomas Klausner <tk@giga.or.at>
Date:   Thu Oct 17 04:35:00 2013 +0000

    Open the fdatasync() fd read/write
    
    Otherwise it will fail for stricter OSes like NetBSD.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=70559

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.