plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | * |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 3 | * Copyright (c) International Business Machines Corp., 2001 |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 4 | * |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 9 | * |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
| 13 | * the GNU General Public License for more details. |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 14 | * |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Wanlong Gao | 4548c6c | 2012-10-19 18:03:36 +0800 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * NAME |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 22 | * execve04.c |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 23 | * |
| 24 | * DESCRIPTION |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 25 | * Testcase to check execve sets the following errnos correctly: |
| 26 | * 1. ETXTBSY |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 27 | * |
| 28 | * ALGORITHM |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 29 | * 1. Attempt to execve(2) a file which is being opened by another |
| 30 | * process for writing fails with ETXTBSY. |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 31 | * |
| 32 | * USAGE: <for command-line> |
| 33 | * execve04 -F <test file> [-c n] [-e] [-i n] [-I x] [-P x] [-t] |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 34 | * where, -c n : Run n copies concurrently. |
| 35 | * -e : Turn on errno logging. |
| 36 | * -i n : Execute test n times. |
| 37 | * -I x : Execute test for x seconds. |
| 38 | * -P x : Pause for x seconds between iterations. |
| 39 | * -t : Turn on syscall timing. |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 40 | * |
| 41 | * HISTORY |
| 42 | * 07/2001 Ported by Wayne Boyer |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 43 | * 04/2008 Roy Lee <roylee@andestech.com> |
| 44 | * - Fix a synchronization issue. |
| 45 | * On a loaded system, the 'execving' child can get access |
| 46 | * to the file before the 'opening' child does, hence results |
| 47 | * in an unexpected opening fail. |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 48 | * |
| 49 | * RESTRICTIONS |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 50 | * must be run with -F <test file> option |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 51 | */ |
| 52 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 53 | #ifndef _GNU_SOURCE |
| 54 | #define _GNU_SOURCE |
| 55 | #endif |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 56 | #include <sys/types.h> |
| 57 | #include <sys/wait.h> |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 58 | #include <errno.h> |
| 59 | #include <fcntl.h> |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 60 | #include <libgen.h> |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 61 | #include <stdio.h> |
| 62 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 63 | #include "test.h" |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 64 | #include "libtestsuite.h" |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 65 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 66 | char *test_app; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 67 | char *TCID = "execve04"; |
| 68 | int TST_TOTAL = 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 69 | |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 70 | void setup(char *); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 71 | void cleanup(void); |
| 72 | void help(void); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 73 | void do_child_1(void); |
| 74 | void do_child_2(void); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 75 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 76 | int start_sync_pipes[2]; |
| 77 | int end_sync_pipes[2]; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 78 | |
| 79 | int Fflag = 0; |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 80 | |
| 81 | #ifdef UCLINUX |
| 82 | #define PIPE_NAME_START "execve04_start" |
| 83 | #define PIPE_NAME_END "execve04_end" |
| 84 | #else |
| 85 | #define PIPE_NAME_START NULL |
| 86 | #define PIPE_NAME_END NULL |
| 87 | #endif |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 88 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 89 | option_t options[] = { |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 90 | {"F:", &Fflag, &test_app}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 91 | {NULL, NULL, NULL} |
| 92 | }; |
| 93 | |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 94 | int main(int ac, char **av) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 95 | { |
Cyril Hrubis | 89af32a | 2012-10-24 16:39:11 +0200 | [diff] [blame] | 96 | int lc; |
Cyril Hrubis | 0b9589f | 2014-05-27 17:40:33 +0200 | [diff] [blame] | 97 | const char *msg; |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 98 | pid_t pid, pid1; |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 99 | int retval = 3, status; |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 100 | char *argv[1], *env[1]; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 101 | |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 102 | if ((msg = parse_opts(ac, av, options, &help)) != NULL) |
Garrett Cooper | 60fa801 | 2010-11-22 13:50:58 -0800 | [diff] [blame] | 103 | tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 104 | #ifdef UCLINUX |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 105 | maybe_run_child(&do_child_1, "nS", 1, &test_app); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 106 | #endif |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 107 | |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 108 | if (!Fflag) |
| 109 | tst_brkm(TBROK, NULL, |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 110 | "You must specify an executable file with the -F option."); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 111 | |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 112 | setup(*av); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 113 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 114 | for (lc = 0; TEST_LOOPING(lc); lc++) { |
| 115 | |
Caspar Zhang | d59a659 | 2013-03-07 14:59:12 +0800 | [diff] [blame] | 116 | tst_count = 0; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 117 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 118 | if (sync_pipe_create(start_sync_pipes, PIPE_NAME_START) == -1) |
| 119 | tst_brkm(TBROK, cleanup, "sync_pipe_create failed"); |
| 120 | if (sync_pipe_create(end_sync_pipes, PIPE_NAME_END) == -1) |
| 121 | tst_brkm(TBROK, cleanup, "sync_pipe_create failed"); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 122 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 123 | /* |
| 124 | * to test whether execve(2) sets ETXTBSY when a second |
| 125 | * child process attempts to execve the executable opened |
| 126 | * by the first child process |
| 127 | */ |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 128 | if ((pid = FORK_OR_VFORK()) == -1) |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 129 | tst_brkm(TBROK, cleanup, "fork #1 failed"); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 130 | else if (pid == 0) { |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 131 | #ifdef UCLINUX |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 132 | if (self_exec(av[0], "nS", 1, test_app) < 0) |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 133 | tst_brkm(TBROK, cleanup, "self_exec failed"); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 134 | #else |
| 135 | do_child_1(); |
| 136 | #endif |
| 137 | } |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 138 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 139 | if (sync_pipe_wait(start_sync_pipes) == -1) |
| 140 | tst_brkm(TBROK, cleanup, "sync_pipe_wait failed"); |
| 141 | |
| 142 | if (sync_pipe_close(start_sync_pipes, PIPE_NAME_START) == -1) |
| 143 | tst_brkm(TBROK, cleanup, "sync_pipe_close failed"); |
| 144 | |
| 145 | if ((pid1 = FORK_OR_VFORK()) == -1) |
| 146 | tst_brkm(TBROK, cleanup, "fork #2 failed"); |
| 147 | |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 148 | if (pid1 == 0) { |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 149 | |
| 150 | retval = 3; |
| 151 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 152 | argv[0] = 0; |
| 153 | env[0] = 0; |
| 154 | |
| 155 | /* do not interfere with end synchronization of first |
| 156 | * child */ |
| 157 | sync_pipe_close(end_sync_pipes, PIPE_NAME_END); |
| 158 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 159 | TEST(execve(test_app, argv, env)); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 160 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 161 | if (TEST_ERRNO != ETXTBSY) { |
| 162 | retval = 1; |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 163 | perror("didn't get ETXTBSY\n"); |
| 164 | } else |
| 165 | printf("execve failed with ETXTBSY as " |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 166 | "expected\n"); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 167 | exit(retval); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 168 | } |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 169 | /* wait for the child to finish */ |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 170 | if (waitpid(pid1, &status, 0) == -1) |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 171 | tst_brkm(TBROK | TERRNO, cleanup, "waitpid failed"); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 172 | if (WIFEXITED(status) && WEXITSTATUS(status) == 3) |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 173 | tst_resm(TPASS, "execve failed as expected"); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 174 | else |
| 175 | tst_resm(TFAIL, "execve succeeded, expected failure"); |
| 176 | |
| 177 | /* terminate first child */ |
| 178 | sync_pipe_notify(end_sync_pipes); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 179 | (void)waitpid(pid, NULL, 0); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 180 | } |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 181 | cleanup(); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 182 | |
Garrett Cooper | 5374050 | 2010-12-16 00:04:01 -0800 | [diff] [blame] | 183 | tst_exit(); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 184 | } |
| 185 | |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 186 | void help(void) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 187 | { |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 188 | printf(" -F <test name> : for example, 'execve04 -F test3'\n"); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 189 | } |
| 190 | |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 191 | void setup(char *argv0) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 192 | { |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 193 | char *cmd, *pwd = NULL; |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 194 | char test_path[MAXPATHLEN]; |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 195 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 196 | if (test_app[0] == '/') |
| 197 | strncpy(test_path, test_app, sizeof(test_path)); |
| 198 | else { |
| 199 | if ((pwd = get_current_dir_name()) == NULL) |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 200 | tst_brkm(TBROK | TERRNO, NULL, "getcwd failed"); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 201 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 202 | snprintf(test_path, sizeof(test_path), "%s/%s", |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 203 | pwd, basename(test_app)); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 204 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 205 | free(pwd); |
| 206 | } |
| 207 | |
Cyril Hrubis | d218f34 | 2014-09-23 13:14:56 +0200 | [diff] [blame] | 208 | cmd = malloc(strlen(test_path) + strlen("cp -p \"") + strlen("\" .") + 1); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 209 | if (cmd == NULL) |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 210 | tst_brkm(TBROK | TERRNO, NULL, "Cannot alloc command string"); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 211 | |
subrata_modak | 635f2a4 | 2008-11-11 06:17:04 +0000 | [diff] [blame] | 212 | tst_sig(FORK, DEF_HANDLER, cleanup); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 213 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 214 | tst_tmpdir(); |
| 215 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 216 | sprintf(cmd, "cp -p \"%s\" .", test_path); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 217 | if (system(cmd) != 0) |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 218 | tst_brkm(TBROK, NULL, "command failed: %s", cmd); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 219 | free(cmd); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 220 | } |
| 221 | |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 222 | void cleanup(void) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 223 | { |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 224 | tst_rmdir(); |
| 225 | |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 226 | } |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 227 | |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 228 | void do_child_1(void) |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 229 | { |
| 230 | int fildes; |
| 231 | |
| 232 | #ifdef UCLINUX |
| 233 | if (sync_pipe_create(start_sync_pipes, PIPE_NAME_START) == -1) |
| 234 | tst_brkm(TBROK, cleanup, "sync_pipe_create failed"); |
| 235 | if (sync_pipe_create(end_sync_pipes, PIPE_NAME_END) == -1) |
| 236 | tst_brkm(TBROK, cleanup, "sync_pipe_create failed"); |
| 237 | #endif |
| 238 | |
Garrett Cooper | c585a27 | 2010-12-20 03:04:07 -0800 | [diff] [blame] | 239 | if ((fildes = open(test_app, O_WRONLY)) == -1) { |
| 240 | printf("%s\n", test_app); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 241 | perror("open failed"); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 242 | exit(1); |
| 243 | } |
| 244 | |
| 245 | if (sync_pipe_notify(start_sync_pipes) == -1) { |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 246 | perror("sync_pipe_notify failed"); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 247 | exit(1); |
| 248 | } |
| 249 | |
| 250 | if (sync_pipe_close(start_sync_pipes, PIPE_NAME_START) == -1) { |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 251 | perror("sync_pipe_close failed"); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 252 | exit(1); |
| 253 | } |
| 254 | |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 255 | if (sync_pipe_wait(end_sync_pipes) == -1) { |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 256 | perror("sync_pipe_wait failed"); |
subrata_modak | e789978 | 2009-05-27 13:36:34 +0000 | [diff] [blame] | 257 | exit(1); |
| 258 | } |
| 259 | exit(0); |
Garrett Cooper | 775c33d | 2010-12-20 01:57:37 -0800 | [diff] [blame] | 260 | } |