diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-13 09:40:45 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-13 09:40:45 +0000 |
commit | c6a2de302900784dd74106091c723862119bdeca (patch) | |
tree | 968e24b3e94edb8e888047b2b1d5120072a1dfe5 /ext | |
parent | fb159b492f4c027d5068e17f0cd3360f31507878 (diff) | |
download | ruby-c6a2de302900784dd74106091c723862119bdeca.tar.gz |
check return value of `write` to suppress warning.
* ext/-test-/gvl/call_without_gvl/call_without_gvl.c (do_loop):
`-Wunused-result` compiler option (gcc?) checks checking
return value of `write`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/-test-/gvl/call_without_gvl/call_without_gvl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c index 654c979479..4b0aafdad1 100644 --- a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c +++ b/ext/-test-/gvl/call_without_gvl/call_without_gvl.c @@ -38,7 +38,8 @@ do_loop(void *p) struct loop_ctl *ctl = p; /* tell the waiting process they can interrupt us, now */ - write(ctl->notify_fd, "", 1); + int err = write(ctl->notify_fd, "", 1); + if (err == -1) rb_bug("write error"); while (!ctl->stop) { struct timeval tv = { 0, 10000 }; |