diff mbox

[RFA] include sys/types.h before sys/prctl.h (for mips-irix).

Message ID 1290531258-1805-1-git-send-email-brobecker@adacore.com
State New
Headers show

Commit Message

Joel Brobecker Nov. 23, 2010, 4:54 p.m. UTC
On mips-irix, sys/prctl.h depends on various types such as ptid_t being
declared.  Otherwise, the build fails as follow:

    /usr/include/sys/prctl.h:45:9: error: expected specifier-qualifier-list before 'pid_t'
    /usr/include/sys/prctl.h:91:17: error: expected specifier-qualifier-list before 'uint32_t'
    [...]

libiberty/ChangeLog:

        * setproctitle.c: If <sys/types.h> exists, include it before including
        <sys/prctl.h>.

Tested on x86_64-linux, where both HAVE_SYS_PRCTL_H and HAVE_SYS_TYPES_H
are defined (I used the gdb-testsuite).  OK to commit?

Thanks,
diff mbox

Patch

diff --git a/libiberty/setproctitle.c b/libiberty/setproctitle.c
index ceb0a38..dfcf000 100644
--- a/libiberty/setproctitle.c
+++ b/libiberty/setproctitle.c
@@ -21,6 +21,9 @@  Boston, MA 02110-1301, USA.  */
 #include "config.h"
 #endif
 #ifdef HAVE_SYS_PRCTL_H
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #include <sys/prctl.h>
 #endif
 #include "ansidecl.h"