зеркало из https://github.com/github/ruby.git
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:
Родитель
ac574fe862
Коммит
244bf0adc7
6
goruby.c
6
goruby.c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче