ncdu-1.11 fails to build on uclibc. Breaks XOPEN standard #67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
(Automatically imported from issue 70 of the old bug tracker)
Description
Created: 2015-06-12 11:54:34 GMT by Anthony G. Basile
ncdu-1.11 fails to build on uclibc systems because it breaks XOPEN. Take a look at `man 3 system`:
SYNOPSIS
#include <stdlib.h>
int system(const char *command);
...
NOTES
If the _XOPEN_SOURCE feature test macro is defined (before including any header files), then the macros described in waitpid(2) (WEXITSTATUS(), etc.) are made available when including <stdlib.h>.
In src/shell.c, <stdlib.h> is included, but _XOPEN_SOURCE is not defined. Yet the code does the following around line 60:
res = system(shell);
...
if (res == -1 || !WIFEXITED(res) || WEXITSTATUS(res) == 127) {
Defining _XOPEN_SOURCE fixes it. uclibc's <stdlib.h> respects _XOPEN_SOURCE around line 42 and conforms to the standard.
See also: https://bugs.gentoo.org/show_bug.cgi?id=550310
Reply 1
Added: 2015-06-12 14:25:23 GMT by Yorhel; Status: new to fixed; Closed: no to yes
Duplicate of:
http://dev.yorhel.nl/ncdu/bug/64
http://dev.yorhel.nl/ncdu/bug/65
Has been patched in
http://g.blicky.net/ncdu.git/commit/?id=29f347c19cb7ad17c4b401e1d984fce8eafaaafa
Reply 2
Added: 2015-06-12 15:11:48 GMT by Anonymous
The BSD solution works on uclibc too.