ncdu-1.11 fails to build on uclibc. Breaks XOPEN standard #67

Closed
opened 2019-03-23 18:03:28 +01:00 by Multi · 0 comments

(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.

_(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<br> &nbsp; #include &lt;stdlib.h><br> &nbsp; int system(const char \*command);<br> ... 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 &lt;stdlib.h>. In src/shell.c, &lt;stdlib.h> is included, but \_XOPEN\_SOURCE is not defined. Yet the code does the following around line 60: &nbsp; res = system(shell);<br> ...<br> &nbsp; if (res == -1 || !WIFEXITED(res) || WEXITSTATUS(res) == 127) { Defining \_XOPEN\_SOURCE fixes it. uclibc's &lt;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:<br> http://dev.yorhel.nl/ncdu/bug/64<br> 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.
Multi added the
imported
label 2019-03-23 18:03:28 +01:00
Multi closed this issue 2019-03-23 18:03:28 +01:00
Sign in to join this conversation.
No labels
1.x
2.x
bug
feature
imported
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: yorhel/ncdu#67
No description provided.