1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

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).
This commit is contained in:
Daniel Shahaf 2018-09-18 18:57:12 +00:00
parent 464065f429
commit db67cc2f4b
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2018-09-25 Daniel Shahaf <d.s@daniel.shahaf.name>
* 43489: Src/exec.c: Add error checking on a new write() call.
2018-09-25 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 43543: Src/jobs.c: Improvements to 43535: attempt to keep

View file

@ -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);