X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fposix_spawn.m4;h=1d17050fbb5f9428cd163180588ee88d50246cdb;hb=454a448e215fff9420769034b21090fd7033975c;hp=89e2f7f06477daa9993a4c9a0eeeab1ef05a9a0d;hpb=979260e3a53de91ae4792e57a6bb801a723a4539;p=gnulib.git diff --git a/m4/posix_spawn.m4 b/m4/posix_spawn.m4 index 89e2f7f06..1d17050fb 100644 --- a/m4/posix_spawn.m4 +++ b/m4/posix_spawn.m4 @@ -1,5 +1,5 @@ -# posix_spawn.m4 serial 5 -dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. +# posix_spawn.m4 serial 9 +dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN([gl_POSIX_SPAWN], AC_DEFUN([gl_POSIX_SPAWN_BODY], [ AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([posix_spawn]) + AC_REQUIRE([gl_HAVE_POSIX_SPAWN]) dnl Assume that when the main function exists, all the others, dnl except posix_spawnattr_{get,set}sched*, are available as well. dnl AC_CHECK_FUNCS_ONCE([posix_spawnp]) @@ -69,8 +69,6 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY], ;; *) REPLACE_POSIX_SPAWN=1 ;; esac - else - HAVE_POSIX_SPAWN=0 fi ]) @@ -293,7 +291,7 @@ parent_main (void) if (fflush (fp) || fclose (fp)) { perror ("cannot prepare data file"); - return 1; + return 2; } /* Avoid reading from our stdin, as it could block. */ @@ -311,7 +309,7 @@ parent_main (void) posix_spawn_file_actions_destroy (&actions); errno = err; perror ("subprocess failed"); - return 1; + return 3; } posix_spawn_file_actions_destroy (&actions); status = 0; @@ -320,13 +318,13 @@ parent_main (void) if (!WIFEXITED (status)) { fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status); - return 1; + return 4; } exitstatus = WEXITSTATUS (status); if (exitstatus != 0) { fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus); - return 1; + return 5; } return 0; } @@ -341,7 +339,7 @@ child_main (void) && memcmp (buf, "Halle Potta", 11) == 0) return 0; else - return 2; + return 8; } static void @@ -393,10 +391,9 @@ main (int argc, char *argv[]) ]) ]) -AC_DEFUN([gl_POSIX_SPAWN_INTERNAL], +# Prerequisites of lib/spawni.c. +AC_DEFUN([gl_PREREQ_POSIX_SPAWN_INTERNAL], [ - AC_LIBOBJ([spawni]) - dnl Prerequisites of lib/spawni.c. AC_CHECK_HEADERS([paths.h]) AC_CHECK_FUNCS([confstr sched_setparam sched_setscheduler setegid seteuid vfork]) ])