]> Savannah Git Hosting - gnulib.git/commitdiff
sched: check struct sched_param in spawn.h as well
authorKO Myung-Hun <komh78@gmail.com>
Thu, 4 Dec 2014 01:03:34 +0000 (10:03 +0900)
committerEric Blake <eblake@redhat.com>
Mon, 8 Dec 2014 20:36:46 +0000 (13:36 -0700)
On OS/2 kLIBC, struct sched_param is in spawn.h. So without this a
redefinition error occurs when sched.h is inclued by spawn.h.

* lib/sched.in.h: Include spawn.h on kLIBC.
* lib/sched_h.m4: Check struct sched_param in spawn.h as well.

ChangeLog
lib/sched.in.h
m4/sched_h.m4

index f308af032d4238e6c8db63508b0a6ff67cc121e8..533add96f2ea5cd735c81555fe611380b643a7e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-08  KO Myung-Hun  <komh78@gmail.com>
+
+       sched: check struct sched_param in spawn.h as well
+       * lib/sched.in.h: Include spawn.h on kLIBC.
+       * lib/sched_h.m4: Check struct sched_param in spawn.h as well.
+
 2014-12-08  Martin Kletzander  <mkletzan@redhat.com>  (tiny change)
 
        bootstrap: Allow perl modules in $buildreq
index edebf81080be992f80be44f78cd7a298f2e29186..7be676128bc3dd55a8a96ebb8c5db813ac5c3c5b 100644 (file)
    and Mac OS X 10.5.  */
 #include <sys/types.h>
 
+#ifdef __KLIBC__
+
+/* On OS/2 kLIBC, struct sched_param is in spawn.h */
+# include <spawn.h>
+
+#endif
+
 #if !@HAVE_STRUCT_SCHED_PARAM@
 
 # if !GNULIB_defined_struct_sched_param
index 329af351ff5023cbb9d936ff9121656a70b715c8..49c10ccdc5da800b21ed8c7177f42c7ad353ecf0 100644 (file)
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 6
+# sched_h.m4 serial 7
 dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -27,9 +27,16 @@ AC_DEFUN([gl_SCHED_H],
      fi
      AC_SUBST([HAVE_SCHED_H])
 
-     AC_CHECK_TYPE([struct sched_param],
-       [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
-       [#include <sched.h>])
+     if test "$HAVE_SCHED_H" = 1; then
+       AC_CHECK_TYPE([struct sched_param],
+         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+         [#include <sched.h>])
+     else
+       dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
+       AC_CHECK_TYPE([struct sched_param],
+         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+         [#include <spawn.h>])
+     fi
      AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
 
      dnl Ensure the type pid_t gets defined.