diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-13 12:28:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-13 12:28:37 +0000 |
commit | 52aa6ab21dcf2e0c6cb0190fbc4f8276248ade6b (patch) | |
tree | 490757266517315416865f290e099d341f018bdf /process.c | |
parent | 9a8440e5d46c67f9938b58d7491659d094c7c4b2 (diff) | |
download | ruby-52aa6ab21dcf2e0c6cb0190fbc4f8276248ade6b.tar.gz |
* process.c (rb_fork_err): suppress gcc 4.4 warnings.
* random.c (fill_random_seed): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2513,10 +2513,12 @@ rb_fork_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALU if (!(*chfunc)(charg, errmsg, errmsg_buflen)) _exit(EXIT_SUCCESS); #ifdef FD_CLOEXEC err = errno; - (void)write(ep[1], &err, sizeof(err)); + if (write(ep[1], &err, sizeof(err)) < 0) err = errno; if (errmsg && 0 < errmsg_buflen) { errmsg[errmsg_buflen-1] = '\0'; - (void)write(ep[1], errmsg, strlen(errmsg)); + errmsg_buflen = strlen(errmsg); + if (errmsg_buflen > 0 &&write(ep[1], errmsg, errmsg_buflen) < 0) + err = errno; } #endif #if EXIT_SUCCESS == 127 |