From e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b Mon Sep 17 00:00:00 2001 From: raf Date: Fri, 6 Jan 2006 13:09:21 -0800 Subject: 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 --- usr/src/lib/libc/port/stdio/system.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'usr/src/lib/libc/port/stdio/system.c') 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 #include #include @@ -52,6 +45,7 @@ #include #include #include +#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) -- cgit v1.2.3