Bug 59263

Summary: fails to build on GNU/Hurd: missing PATH_MAX
Product: cups-pk-helper Reporter: Pino Toscano <toscano.pino>
Component: GeneralAssignee: Marek Kasik <mkasik>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: vuntz
Version: unspecified   
Hardware: Other   
OS: other   
Whiteboard:
i915 platform: i915 features:
Attachments: Introduce and use CPH_PATH_MAX

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.