diff options
author | raf <none@none> | 2006-01-06 13:09:21 -0800 |
---|---|---|
committer | raf <none@none> | 2006-01-06 13:09:21 -0800 |
commit | e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b (patch) | |
tree | 8ded5f3bcfc9f92ca50e6639f7063ea0afd17fa7 /usr/src/lib/libc/port/stdio/system.c | |
parent | a7aa4df776b2ef44358da774101a0a3039d69100 (diff) | |
download | illumos-gate-e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b.tar.gz |
6362982 namespace pollution/protection in libc
6369040 there should be but one synonyms.h file outside of libc
--HG--
rename : usr/src/lib/common/inc/mtlib.h => deleted_files/usr/src/lib/common/inc/mtlib.h
rename : usr/src/lib/libc/sparcv9/gen/llabs.s => deleted_files/usr/src/lib/libc/sparcv9/gen/llabs.s
rename : usr/src/lib/libcurses/screen/synonyms.h => deleted_files/usr/src/lib/libcurses/screen/synonyms.h
rename : usr/src/lib/libmail/inc/synonyms.h => deleted_files/usr/src/lib/libmail/inc/synonyms.h
rename : usr/src/lib/libresolv/synonyms.h => deleted_files/usr/src/lib/libresolv/synonyms.h
rename : usr/src/lib/libresolv2/include/synonyms.h => deleted_files/usr/src/lib/libresolv2/include/synonyms.h
rename : usr/src/lib/librsm/inc/synonyms.h => deleted_files/usr/src/lib/librsm/inc/synonyms.h
rename : usr/src/ucblib/libucb/port/gen/synonyms.h => deleted_files/usr/src/ucblib/libucb/port/gen/synonyms.h
rename : usr/src/lib/common/inc/synonyms.h => usr/src/lib/common/inc/c_synonyms.h
rename : usr/src/lib/libcrypt/inc/synonyms.h => usr/src/lib/libcrypt/inc/des_synonyms.h
rename : usr/src/lib/libgen/inc/synonyms.h => usr/src/lib/libgen/inc/gen_synonyms.h
Diffstat (limited to 'usr/src/lib/libc/port/stdio/system.c')
-rw-r--r-- | usr/src/lib/libc/port/stdio/system.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/usr/src/lib/libc/port/stdio/system.c b/usr/src/lib/libc/port/stdio/system.c index 45e11aeeac..b641e6592e 100644 --- a/usr/src/lib/libc/port/stdio/system.c +++ b/usr/src/lib/libc/port/stdio/system.c @@ -19,8 +19,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -32,14 +33,6 @@ #include "synonyms.h" #include "mtlib.h" - -/* - * system() is a cancellation point. - * Undefine waitpid so we call the real waitpid() rather than _waitpid(). - * This ensures that we actually perform the cancellation logic. - */ -#undef waitpid - #include <sys/types.h> #include <sys/wait.h> #include <signal.h> @@ -52,6 +45,7 @@ #include <errno.h> #include <synch.h> #include <spawn.h> +#include "libc.h" extern const char **environ; @@ -221,9 +215,14 @@ system(const char *cmd) errno = error; status = -1; } else { + /* + * system() is a cancellation point. + * Call waitpid_cancel() rather than _waitpid() to make + * sure that we actually perform the cancellation logic. + */ pthread_cleanup_push(cleanup, &savemask); do { - w = waitpid(pid, &status, 0); + w = waitpid_cancel(pid, &status, 0); } while (w == -1 && errno == EINTR); pthread_cleanup_pop(0); if (w == -1) |