annotate tests/test-posix_spawn3.c @ 16465:c0803728f645

New module 'modfl-ieee'. * modules/modfl-ieee: New file.
author Bruno Haible <bruno@clisp.org>
date Sun, 26 Feb 2012 17:55:31 +0100
parents 8250f2777afc
children e542fd46ad6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10687
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of posix_spawn() function.
16201
8250f2777afc maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
2 Copyright (C) 2008-2012 Free Software Foundation, Inc.
10687
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2008. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 /* Test whether posix_spawn_file_actions_addopen supports filename arguments
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 that contain special characters such as '*'. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <config.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <spawn.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
12489
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 11049
diff changeset
26 #include "signature.h"
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 11049
diff changeset
27 SIGNATURE_CHECK (posix_spawn, int, (pid_t *, char const *,
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 11049
diff changeset
28 posix_spawn_file_actions_t const *,
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 11049
diff changeset
29 posix_spawnattr_t const *,
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 11049
diff changeset
30 char *const[], char *const[]));
10687
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 #include <errno.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 #include <fcntl.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 #include <signal.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 #include <stdbool.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #include <stdio.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 #include <string.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #include <unistd.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 #include <sys/types.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #include <sys/wait.h>
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 extern char **environ;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #define CHILD_PROGRAM_FILENAME "test-posix_spawn3"
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 #define DATA_FILENAME "t!#$%&'()*+,-;=?@[\\]^_`{|}~.tmp"
12739
28283035637b posix_spawn: Avoid test failure on Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
45 /* On Cygwin, '*' '?' '\\' '|' cannot be used in file names. */
28283035637b posix_spawn: Avoid test failure on Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
46 #if defined __CYGWIN__
28283035637b posix_spawn: Avoid test failure on Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
47 # undef DATA_FILENAME
28283035637b posix_spawn: Avoid test failure on Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
48 # define DATA_FILENAME "t!#$%&'()+,-;=@[]^_`{}~.tmp"
28283035637b posix_spawn: Avoid test failure on Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
49 #endif
10687
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 static int
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 parent_main (void)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 FILE *fp;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 posix_spawn_file_actions_t actions;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 bool actions_allocated;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 int err;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 pid_t child;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 int status;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 int exitstatus;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 /* Create a data file with specific contents. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 fp = fopen (DATA_FILENAME, "wb");
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 if (fp == NULL)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 perror ("cannot create data file");
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 return 1;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 fwrite ("Halle Potta", 1, 11, fp);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 if (fflush (fp) || fclose (fp))
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 perror ("cannot prepare data file");
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 return 1;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 /* Avoid reading from our stdin, as it could block. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 freopen ("/dev/null", "rb", stdin);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 /* Test whether posix_spawn_file_actions_addopen with this file name
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 actually works, but spawning a child that reads from this file. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 actions_allocated = false;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 if ((err = posix_spawn_file_actions_init (&actions)) != 0
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 || (actions_allocated = true,
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 if (actions_allocated)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 posix_spawn_file_actions_destroy (&actions);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 errno = err;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 perror ("subprocess failed");
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 return 1;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 posix_spawn_file_actions_destroy (&actions);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 status = 0;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 while (waitpid (child, &status, 0) != child)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 ;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 if (!WIFEXITED (status))
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 return 1;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 exitstatus = WEXITSTATUS (status);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 if (exitstatus != 0)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 return 1;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 return 0;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 static int
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 child_main (void)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 char buf[1024];
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 /* See if reading from STDIN_FILENO yields the expected contents. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 if (fread (buf, 1, sizeof (buf), stdin) == 11
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 && memcmp (buf, "Halle Potta", 11) == 0)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 return 0;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 else
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 return 2;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 static void
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 cleanup_then_die (int sig)
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 /* Clean up data file. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 unlink (DATA_FILENAME);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 /* Re-raise the signal and die from it. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 signal (sig, SIG_DFL);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 raise (sig);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 int
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 main (int argc, char *argv[])
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 int exitstatus;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 /* This is the parent process. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 signal (SIGINT, cleanup_then_die);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 signal (SIGTERM, cleanup_then_die);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 #ifdef SIGHUP
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 signal (SIGHUP, cleanup_then_die);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 #endif
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150 exitstatus = parent_main ();
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 else
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153 {
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
154 /* This is the child process. */
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
156 exitstatus = child_main ();
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 }
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 unlink (DATA_FILENAME);
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
159 return exitstatus;
8ddeb7137f43 Tests for posix_spawn function.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160 }