opendir-safer.c: don't clobber errno; don't close negative FD
[pspp] / lib / spawnattr_setschedparam.c
index c1c2888eea307134af60541ca2b12ba4a2897bf2..4416a3b49a56927851df44e350224279aea3c9b5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -24,8 +24,11 @@ int
 posix_spawnattr_setschedparam (posix_spawnattr_t *attr,
                                const struct sched_param *schedparam)
 {
+  /* Do nothing if POSIX_SPAWN_SETSCHEDPARAM is unsupported.  */
+#if POSIX_SPAWN_SETSCHEDPARAM != 0
   /* Store the scheduling parameters.  */
   attr->_sp = *schedparam;
+#endif
 
   return 0;
 }