[POSIX] incorrect included header files in src/color-profile.cpp for open(2)

Bug #910335 reported by Milan Juřík
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned
inkscape (ALT Linux)
New
Undecided
Unassigned

Bug Description

src/color-profile.cpp includes sys/fcntl.h but it should include the whole set of headers for syscall open (fix build on Solaris)

Tags: build

Related branches

Revision history for this message
Milan Juřík (milan-jurik) wrote :
su_v (suv-lp)
summary: - incorrect included header files in src/color-profile.cpp for open(2)
+ [Solaris] incorrect included header files in src/color-profile.cpp for
+ open(2)
tags: added: build
Revision history for this message
Jon A. Cruz (jon-joncruz) wrote : Re: [Solaris] incorrect included header files in src/color-profile.cpp for open(2)

Looks like an OS difference, and one that would warrant some autoconf and #ifdef conditioning.

Revision history for this message
su_v (suv-lp) wrote :

Duplicate of, or covered by Bug #740969 in Inkscape: “build problems on Oracle "Solaris 10" X86_64”?
<https://bugs.launchpad.net/inkscape/+bug/740969>

Revision history for this message
su_v (suv-lp) wrote :

See also:
CompilingSunSolaris - Inkscape Wiki:
<http://wiki.inkscape.org/wiki/index.php/CompilingSunSolaris>

Revision history for this message
Milan Juřík (milan-jurik) wrote :

It is not Solaris specific issue, look at open(2) manpage in Linux (e.g. ,http://linux.die.net/man/2/open), including just sys/fcntl.h is not enough, it works on some Linux distros only because of luck. It is not about some ifdef, it is about POSIX.

nightrow (jb-benoit)
Changed in inkscape:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
John Spencer (maillist-launchpad) wrote :

this is really just an oversight of the developer who mistakenly added the wrong declaration, which happened to work on his system (glibc).

this really doesnt compile anywhere except on glibc.
and it is completely trivial to fix since glibc also has the right header

see the posix specs here:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html

affected distro: sabotage linux, using musl libc [1]
[1] http://www.musl-libc.org

su_v (suv-lp)
summary: - [Solaris] incorrect included header files in src/color-profile.cpp for
+ [POSIX] incorrect included header files in src/color-profile.cpp for
open(2)
Revision history for this message
John Spencer (maillist-launchpad) wrote :

btw, the proposed patch above is overkill
it is sufficient to only change sys/fcntl.h to fcntl.h.
there are no other missing symbols.

i can tell this for sure since musl doesnt expose any superfluous symbols, unlike glibc which has the habit of including other headers (e.g. stdio.h there pulls in stdlib.h which is a namespace violation)

Revision history for this message
jazzynico (jazzynico) wrote :

> btw, the proposed patch above is overkill
> it is sufficient to only change sys/fcntl.h to fcntl.h

Change tested on Windows XP and Debian testing, Inkscape trunk revision 12007.
The application compiles and runs with no problem on both systems.

If it's ok on OS X, I guess it's safe to commit it.

Revision history for this message
su_v (suv-lp) wrote :

> If it's ok on OS X, I guess it's safe to commit it.

Seems to compile and run ok on Mac OS X 10.5.8 (Xcode 3.1.4) and OS X 10.7 (Xcode 4.3.2) - I can't test on the most recent version OS X 10.8 (with Xcode 4.5.2) though.

On 10.5 and 10.7, the main content of '/usr/include/fcntl.h' is to include <sys/fcntl.h>:

$ tail -2 /usr/include/fcntl.h
 */
#include <sys/fcntl.h>

Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 12009.
 Milan and John, Thanks!

Changed in inkscape:
milestone: none → 0.49
status: Triaged → Fix Committed
tags: added: backport-proposed
Revision history for this message
su_v (suv-lp) wrote :

Fix backported to lp:inkscape/0.48.x in revision 9997.

Changed in inkscape:
milestone: 0.49 → 0.48.5
tags: removed: backport-proposed
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.