artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
203d5f9
)
Use waitpid() instead of wait() to avoid returning early from another child
author
guenther
<guenther@openbsd.org>
Fri, 23 Oct 2015 04:45:32 +0000
(
04:45
+0000)
committer
guenther
<guenther@openbsd.org>
Fri, 23 Oct 2015 04:45:32 +0000
(
04:45
+0000)
exiting, and loop the waitpid() on EINTR
ok deraadt@ millert@
lib/libc/net/rcmdsh.c
patch
|
blob
|
history
diff --git
a/lib/libc/net/rcmdsh.c
b/lib/libc/net/rcmdsh.c
index
ad3f79e
..
a8cd0e6
100644
(file)
--- a/
lib/libc/net/rcmdsh.c
+++ b/
lib/libc/net/rcmdsh.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: rcmdsh.c,v 1.1
5 2015/09/12 14:56:50
guenther Exp $ */
+/* $OpenBSD: rcmdsh.c,v 1.1
6 2015/10/23 04:45:32
guenther Exp $ */
/*
* Copyright (c) 2001, MagniComp
@@
-176,7
+176,8
@@
rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser,
/* Parent. close sp[1], return sp[0]. */
(void) close(sp[1]);
/* Reap child. */
- (void) wait(NULL);
+ while (waitpid(cpid, NULL, 0) == -1 && errno == EINTR)
+ ;
return(sp[0]);
}
/* NOTREACHED */