goruby.c: suppress warning

* goruby.c (goruby_options): check the result of `write(2)` to
  suppress unused-result warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-08-10 04:48:10 +00:00
parent ac574fe862
commit 244bf0adc7
1 changed files with 4 additions and 2 deletions

View File

@ -32,12 +32,14 @@ goruby_options(int argc, char **argv)
void *ret;
if ((isatty(0) && isatty(1) && isatty(2)) && (pipe(rw) == 0)) {
ssize_t n;
infd = dup(0);
if (infd < 0) return NULL;
dup2(rw[0], 0);
close(rw[0]);
write(rw[1], cmd, sizeof(cmd) - 1);
n = write(rw[1], cmd, sizeof(cmd) - 1);
close(rw[1]);
ret = ruby_options(argc, argv);
ret = n > 0 ? ruby_options(argc, argv) : NULL;
dup2(infd, 0);
close(infd);
return ret;