Bug 59263 - fails to build on GNU/Hurd: missing PATH_MAX
Summary: fails to build on GNU/Hurd: missing PATH_MAX
Status: RESOLVED FIXED
Alias: None
Product: cups-pk-helper
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other other
: medium normal
Assignee: Marek Kasik
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-12 00:10 UTC by Pino Toscano
Modified: 2016-01-28 12:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Introduce and use CPH_PATH_MAX (1.28 KB, patch)
2013-01-12 00:10 UTC, Pino Toscano
Details | Splinter Review

Description Pino Toscano 2013-01-12 00:10:45 UTC
Created attachment 72881 [details] [review]
Introduce and use CPH_PATH_MAX

Hi,

when building cups-pk-helper >= 0.2.3 on GNU/Hurd, it fails like this:

| make[3]: Entering directory `$SRCDIR/src'
|   CC     cups_pk_helper_mechanism-cups.o
| cups.c: In function ‘_cph_cups_prepare_ppd_for_options’:
| cups.c:2394:34: error: ‘PATH_MAX’ undeclared (first use in this function)
| cups.c:2394:34: note: each undeclared identifier is reported only once for each | function it appears in
| cups.c:2394:23: warning: unused variable ‘newppdfile’ [-Wunused-variable]
| make[3]: *** [cups_pk_helper_mechanism-cups.o] Error 1

this happens because PATH_MAX is an optional constant in POSIX, and the Hurd does not provide it on purpose.

Unfortunately, the cups API used just wants a char* buffer and its size [*], so all we can do is just passing a buffer large enough; I've defined CPH_PATH_MAX to be PATH_MAX if available (or 1024 if not).

[*] not even checking internally the buffer is large enough for the job, merely truncating it at the passed size...
Comment 1 Vincent Untz 2013-03-01 08:24:57 UTC
Marek is taking over maintainership, reassigning bugs to him.
Comment 2 Marek Kasik 2016-01-28 12:15:30 UTC
Thank you for the patch. I've pushed it to master.


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.