Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Add error checking on a new write() call.
- X-seq: zsh-workers 43489
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Add error checking on a new write() call.
- Date: Tue, 18 Sep 2018 18:57:12 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=mX2s3q66QXmLISn0N oT4o+YoilCBFABt1Y1y0mpqeJU=; b=a3G+pdV4+O1NsRvyOFeRcSqZox//xF1tY JkC/ZBo2KpOl46owNepAAk5QAi6BPtD420SMF6QChVPKVoP8wViKtMCx3YhTRfZh 8S7wulbU3v+Anp4oEcHe7BavrnfDImR9JQNf4tIeyal6FNqp5mc3EawEDHlnuzHo O6oX0hXvHFlN/sSN14IAgbRm2UWLqJTLe9UjKK313sE3theybsf2db0OKDv79oVF eVkZhJ095aI7/lp65pdN6HooTeN7t+jwqmxd9EFOZNrhQG1f69eogGqiV2UBnQXL /jeE0kQp+VViMnwthtNeColleE3+Xhp/ZZtT9Qs9MmrjCkYf+aeUA==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mX2s3q66QXmLISn0N oT4o+YoilCBFABt1Y1y0mpqeJU=; b=NELGTjGKIxwTECQy9DBQdb7wz/MQzYBTU rNmnLbC/0cV10HYHLe48fKfCTwspp0OWU5efHAw8C8cFz2IP0K4+dZg5GiE3kHXW xxwVQ6Ua+e8cmncsvgHk1nfqksdceD9CQeA2UVt3i7TORHmvhAL4crpIlPV1UcuC Hm1u888t2qKSWkgyxycW53rBHaq/uXnTTFOl7A3QwlYFPfF5yaWWElK647ySamNO /iAynk2NGzYj2gbXwwGwzEgv3pjgbPkUh5o91lvZTe0ADw7uWaLsjJU46tFer0QP xLJp//tE/R38CaWA68zoKB93GsRd8Z1Lz4DaQ8ARhRAHs8B4An6PA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Silences a compiler warning (write(2) is declared with warn_unused_result
in current Debian Unstable).
---
This is mainly in order to make the build more warning-free, since that
write(2) call isn't _that_ likely to fail in practice.
Cheers,
Daniel
Src/exec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author