aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-11-26 13:48:00 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-11-26 13:48:00 +0000
commit6fe752f94f16b278f3415d82b202d32aab7ad84d (patch)
tree8c2732e6710b991351d57d9b8433f13952d1b270
parentd264970f79a6b8b67ee87bd995d2b73265b5673d (diff)
downloadnewlib-6fe752f94f16b278f3415d82b202d32aab7ad84d.zip
newlib-6fe752f94f16b278f3415d82b202d32aab7ad84d.tar.gz
newlib-6fe752f94f16b278f3415d82b202d32aab7ad84d.tar.bz2
* libc/posix/posix_spawn.c: Eliminate OS function calls not present
in newlib or Cygwin. (process_spawnattr): Use sigprocmask rather than _sigprocmask. Use sigaction rather than _sigaction. (process_file_actions_entry): Use dup2 rather than _dup2. (do_posix_spawn): Use execvpe rather than _execvpe. Use waitpid rather than _waitpid.
-rw-r--r--newlib/ChangeLog10
-rw-r--r--newlib/libc/posix/posix_spawn.c18
2 files changed, 19 insertions, 9 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index f483032..f2c9dba 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,13 @@
+2013-11-26 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/posix/posix_spawn.c: Eliminate OS function calls not present
+ in newlib or Cygwin.
+ (process_spawnattr): Use sigprocmask rather than _sigprocmask. Use
+ sigaction rather than _sigaction.
+ (process_file_actions_entry): Use dup2 rather than _dup2.
+ (do_posix_spawn): Use execvpe rather than _execvpe. Use waitpid
+ rather than _waitpid.
+
2013-11-25 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/iconv/lib/iconv.c, libc/time/strftime.c: Change "restrict<" to
diff --git a/newlib/libc/posix/posix_spawn.c b/newlib/libc/posix/posix_spawn.c
index 2d27370..d27c08a 100644
--- a/newlib/libc/posix/posix_spawn.c
+++ b/newlib/libc/posix/posix_spawn.c
@@ -80,9 +80,9 @@ argument is unspecified.
PORTABILITY
POSIX.1-2008 requires <<posix_spawn>> and <<posix_spawnp>>.
-Supporting OS subroutines required: <<_close>>, <<_dup2>>, <<_fcntl>>,
-<<_execve>>, <<_execvpe>>, <<_exit>>, <<_open>>, <<_sigaction>>,
-<<_sigprocmask>>, <<_waitpid>>, <<sched_setscheduler>>,
+Supporting OS subroutines required: <<_close>>, <<dup2>>, <<_fcntl>>,
+<<_execve>>, <<execvpe>>, <<_exit>>, <<_open>>, <<sigaction>>,
+<<sigprocmask>>, <<waitpid>>, <<sched_setscheduler>>,
<<sched_setparam>>, <<setegid>>, <<seteuid>>, <<setpgid>>, <<vfork>>.
*/
@@ -186,13 +186,13 @@ process_spawnattr(_CONST posix_spawnattr_t sa)
/* Set signal masks/defaults */
if (sa->sa_flags & POSIX_SPAWN_SETSIGMASK) {
- _sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL);
+ sigprocmask(SIG_SETMASK, &sa->sa_sigmask, NULL);
}
if (sa->sa_flags & POSIX_SPAWN_SETSIGDEF) {
for (i = 1; i < NSIG; i++) {
if (sigismember(&sa->sa_sigdefault, i))
- if (_sigaction(i, &sigact, NULL) != 0)
+ if (sigaction(i, &sigact, NULL) != 0)
return (errno);
}
}
@@ -212,7 +212,7 @@ process_file_actions_entry(posix_spawn_file_actions_entry_t *fae)
if (fd < 0)
return (errno);
if (fd != fae->fae_fildes) {
- if (_dup2(fd, fae->fae_fildes) == -1)
+ if (dup2(fd, fae->fae_fildes) == -1)
return (errno);
if (_close(fd) != 0) {
if (errno == EBADF)
@@ -226,7 +226,7 @@ process_file_actions_entry(posix_spawn_file_actions_entry_t *fae)
break;
case FAE_DUP2:
/* Perform a dup2() */
- if (_dup2(fae->fae_fildes, fae->fae_newfildes) == -1)
+ if (dup2(fae->fae_fildes, fae->fae_newfildes) == -1)
return (errno);
#ifdef HAVE_FCNTL
if (_fcntl(fae->fae_newfildes, F_SETFD, 0) == -1)
@@ -281,14 +281,14 @@ do_posix_spawn(pid_t *pid, _CONST char *path,
_exit(127);
}
if (use_env_path)
- _execvpe(path, argv, envp != NULL ? envp : *p_environ);
+ execvpe(path, argv, envp != NULL ? envp : *p_environ);
else
_execve(path, argv, envp != NULL ? envp : *p_environ);
error = errno;
_exit(127);
default:
if (error != 0)
- _waitpid(p, NULL, WNOHANG);
+ waitpid(p, NULL, WNOHANG);
else if (pid != NULL)
*pid = p;
return (error);