Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 550310

Summary: sys-fs/ncdu-1.11 build fix on sys-libs/uclibc
Product: Gentoo Linux Reporter: René Rhéaume <rene.rheaume>
Component: Current packagesAssignee: Wolfram Schlich (RETIRED) <wschlich>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: http://dev.yorhel.nl/ncdu/bug/70
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ncdu-1.11-uclibc.patch
ncdu-1.11.ebuild.patch

Description René Rhéaume 2015-05-24 16:28:27 UTC
Created attachment 403872 [details, diff]
ncdu-1.11-uclibc.patch

ncdu 1.11 misses an include file to be buildable on uclibc-based systems. The following patch adds the missing include.
Comment 1 René Rhéaume 2015-05-24 16:31:12 UTC
Created attachment 403874 [details, diff]
ncdu-1.11.ebuild.patch
Comment 2 Anthony Basile gentoo-dev 2015-06-12 11:49:55 UTC
(In reply to René Rhéaume from comment #0)
> Created attachment 403872 [details, diff] [details, diff]
> ncdu-1.11-uclibc.patch
> 
> ncdu 1.11 misses an include file to be buildable on uclibc-based systems.
> The following patch adds the missing include.

Actually this is not the correct way to deal with this.  Take a look at `man 3 system`.  There we see:

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.  Take a look at uclibc's <stdlib.h> around line 42.

@wschlich  I'll open a bug upstream and take care of this one.  I don't want to burdon devs with uclibc stuff.
Comment 3 Anthony Basile gentoo-dev 2015-06-12 15:14:09 UTC
We should backport the usptream fix:

http://g.blicky.net/ncdu.git/commit/?id=29f347c19cb7ad17c4b401e1d984fce8eafaaafa

@wschlich.  May I go ahead and commit?
Comment 4 Anthony Basile gentoo-dev 2015-06-17 12:18:16 UTC
(In reply to Anthony Basile from comment #3)
> We should backport the usptream fix:
> 
> http://g.blicky.net/ncdu.git/commit/
> ?id=29f347c19cb7ad17c4b401e1d984fce8eafaaafa
> 
> @wschlich.  May I go ahead and commit?

@wschlich, ping
Comment 5 Anthony Basile gentoo-dev 2015-06-28 22:54:10 UTC
I backported the patch to 1.11 without rev bump.