Created attachment 82874 [details] [review] Get rid of the usage of PATH_MAX Currently, libxkbcommon does not compile on GNU/Hurd; this happens because on the Hurd PATH_MAX (optional in POSIX) is not provided, while such constant is unconditionally used in two places (a source of the main library, and in the test suite). Attached there is a patch that gets rid of the PATH_MAX usages, allocating and freeing buffers as needed. To avoid too many malloc/free in the for loop in FindFileInXkbPath, a buffer is grown according to the size needed at each iteration.
Comment on attachment 82874 [details] [review] Get rid of the usage of PATH_MAX Review of attachment 82874 [details] [review]: ----------------------------------------------------------------- The patch looks good (we have src/darray.h which can do some of the boilerplate but that's fine here). Can you create the patch though with 'git format-patch' rather than 'git diff' (with commit message and author etc.) so we can apply it?
(In reply to comment #1) > The patch looks good (we have src/darray.h which can do some of the > boilerplate but that's fine here). It seems darray doesn't handle malloc/realloc failures though. > Can you create the patch though with 'git format-patch' rather than 'git > diff' (with commit message and author etc.) so we can apply it? Sure, here it is.
Created attachment 82904 [details] [review] Get rid of the usage of PATH_MAX
(In reply to comment #2) > (In reply to comment #1) > > The patch looks good (we have src/darray.h which can do some of the > > boilerplate but that's fine here). > > It seems darray doesn't handle malloc/realloc failures though. Yes, OOM handling is a "TODO" so to speak (the main problem being around the parser / keymap compiler). > > Can you create the patch though with 'git format-patch' rather than 'git > > diff' (with commit message and author etc.) so we can apply it? > > Sure, here it is. Thanks!
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.