summaryrefslogtreecommitdiff
path: root/usr.bin/tput
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tput')
-rw-r--r--usr.bin/tput/tput.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c
index 8289ad3d2f3..e3fa82c3812 100644
--- a/usr.bin/tput/tput.c
+++ b/usr.bin/tput/tput.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tput.c,v 1.22 2015/11/16 03:03:28 deraadt Exp $ */
+/* $OpenBSD: tput.c,v 1.23 2017/08/21 21:41:13 deraadt Exp $ */
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -52,6 +52,7 @@
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
+#include <errno.h>
#include <limits.h>
#include <string.h>
@@ -269,9 +270,10 @@ init(void)
size_t len;
char *buf;
int wstatus;
+ pid_t pid;
if (init_prog && !issetugid()) {
- switch (vfork()) {
+ switch (pid = vfork()) {
case -1:
err(4, "vfork");
break;
@@ -281,7 +283,10 @@ init(void)
_exit(127);
break;
default:
- wait(&wstatus);
+ while (waitpid(pid, &wstatus, 0) == -1) {
+ if (errno != EINTR)
+ break;
+ }
/* parent */
break;
}