Bug 63423 - sd-daemon.c: include POSIX fcntl.h rather than OS-specific sys/fcntl.h
Summary: sd-daemon.c: include POSIX fcntl.h rather than OS-specific sys/fcntl.h
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-11 13:21 UTC by Simon McVittie
Modified: 2013-04-14 01:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2013-04-11 13:21:11 UTC
On Bug #61176, Matt Fischer points out that QNX does not have the popular-but-non-standard header <sys/fcntl.h>, only the "official" POSIX <fcntl.h>. This broke libdbus builds in the embedded copy of sd-daemon.c (which we should probably get rid of, but that's not the point right now). Matt said he'd open a systemd bug, but I couldn't find one, so I'm opening this.

sd-daemon.c currently does this:

    #ifdef __BIONIC__
    #  include <linux/fcntl.h>
    #else
    #  include <sys/fcntl.h>
    #endif

but if we used <fcntl.h> we shouldn't need the ugly conditional, unless there's some special reason why you prefer the OS-specific version - more contents or something?

libdbus already uses #include <fcntl.h> in its other Unix-specific files, so this is at least as portable as D-Bus - in particular, it compiles on Android. Given the sort of esoteric platforms I've heard about people putting D-Bus on, I think we can safely assume that <fcntl.h> is portable.
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-04-14 01:10:58 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=abad76cc4.


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.