summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2018-09-18 18:57:12 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2018-09-25 19:35:15 +0000
commitdb67cc2f4b5b1282cb2be719ebb6bfd5a52f9169 (patch)
tree9155b09ff5a51bc83994dbef82d5ac6728c76865 /Src/exec.c
parent464065f42959abc655b8e680572c08793dd0c56e (diff)
downloadzsh-db67cc2f4b5b1282cb2be719ebb6bfd5a52f9169.tar.gz
zsh-db67cc2f4b5b1282cb2be719ebb6bfd5a52f9169.tar.xz
zsh-db67cc2f4b5b1282cb2be719ebb6bfd5a52f9169.zip
43489: Add error checking on a new write() call.
Silences a compiler warning (write(2) is declared with warn_unused_result
in current Debian Unstable).
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index a667b078d..1d537af24 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2745,7 +2745,10 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc,
 	flags |= ESUB_JOB_CONTROL;
     *filelistp = jobtab[thisjob].filelist;
     entersubsh(flags, &esret);
-    write(synch[1], &esret, sizeof(esret));
+    if (write_loop(synch[1], (const void *) &esret, sizeof(esret)) != sizeof(esret)) {
+	zerr("Failed to send entersubsh_ret report: %e", errno);
+	return -1;
+    }
     close(synch[1]);
     zclose(close_if_forked);