! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar fails to build on GNU/Hurd because of undefined MAXPATHLEN
Status:
RESOLVED: FIXED

Comments

Description Yves-Alexis Perez editbugs 2011-04-21 10:54:03 CEST
Created attachment 3626 
fix MAXPATHLEN beeing undefined on GNU/Hurd

Hey,

this is more or less the same thing as #7521 for xfce4-settings. MAXPATHLEN isn't a POSIX thing and is undefined on GNU/Hurd, so Thunar will fail to build.

A build log is available at https://buildd.debian.org/status/fetch.php?pkg=thunar&arch=hurd-i386&ver=1.2.1-5&stamp=1303373939 and the attached patch should fix the problem by using get_current_dir_name() which allocates the needed memory itself.
Comment 1 Yves-Alexis Perez editbugs 2011-04-21 10:57:59 CEST
Hmh, get_current_dir_name() might be a glibc specific function though.
Comment 2 Yves-Alexis Perez editbugs 2011-04-21 11:09:55 CEST
Yup, it's not POSIX either so in this case it might be easiest to use a #define MAXPATHLEN 4096.
Comment 3 Yves-Alexis Perez editbugs 2011-04-21 11:41:41 CEST
Created attachment 3627 
fix MAXPATHLEN beeing undefined on GNU/Hurd

Another attempt, using get_current_dir_name() on GNU systems, with a fallback on getcwd() with MAXPATHLEN on other (and another fallback on non GNU systems without MAXPATHLEN, though I'm not sure they do exist).
Comment 4 Yves-Alexis Perez editbugs 2011-04-21 12:35:31 CEST
Created attachment 3629 
fix MAXPATHLEN beeing undefined on GNU/Hurd

It seems that there is a g_get_current_dir() in glib (http://developer.gnome.org/glib/2.26/glib-Miscellaneous-Utility-Functions.html#g-get-current-dir) which abstracts this, so here's a new patch using it and simplifying the code.
Comment 5 Yves-Alexis Perez editbugs 2011-04-21 12:47:14 CEST
Created attachment 3630 
fix MAXPATHLEN beeing undefined on GNU/Hurd

Ok, yet another attempt, simplify again by using g_chdir() and removing the #ifdef for Windows.
Comment 6 Yves-Alexis Perez editbugs 2011-04-21 12:49:51 CEST
Created attachment 3631 
fix MAXPATHLEN beeing undefined on GNU/Hurd

Grmbl, sorry for the flood, previous patch lacked an include for the relevant headers. Not sure if they're supposed to be included like that though.
Comment 7 Nick Schermer editbugs 2011-04-21 17:02:55 CEST
Fixed in 9b80264.

Bug #7522

Reported by:
Yves-Alexis Perez
Reported on: 2011-04-21
Last modified on: 2011-04-21

People

Assignee:
Jannis Pohlmann
CC List:
1 user

Version

Attachments

Additional information