diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-05 09:57:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-05 09:57:00 +0000 |
commit | b526738c3b27bc67a3e1017a051aab1163a34117 (patch) | |
tree | 05effc78bbcafc051bdd7a057993893ef75ea6c9 /io.c | |
parent | 8baffe6ef664e53a6acf0c3f52e900d37780fabb (diff) | |
download | ruby-b526738c3b27bc67a3e1017a051aab1163a34117.tar.gz |
* bignum.c (big_rshift), compile.c (validate_label,
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c
(dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open)
(rb_io_advise), parse.y (parser_compile_string)
(rb_parser_compile_file), proc.c (binding_free), process.c
(rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core)
(p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null),
signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main),
vm_insnhelper.c (vm_expandarray): suppress
unused-but-set-variable warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -5353,12 +5353,15 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode, int fd = -1; int write_fd = -1; const char *cmd = 0; +#if !defined(HAVE_FORK) int argc; VALUE *argv; +#endif if (prog) cmd = StringValueCStr(prog); +#if !defined(HAVE_FORK) if (!eargp) { /* fork : IO.popen("-") */ argc = 0; @@ -5374,6 +5377,7 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode, argc = 0; argv = 0; } +#endif #if defined(HAVE_FORK) arg.execp = eargp; @@ -7859,7 +7863,7 @@ do_io_advise(rb_io_t *fptr, VALUE advice, off_t offset, off_t len) * The platform doesn't support this hint. We don't raise exception, instead * silently ignore it. Because IO::advise is only hint. */ - if (num_adv == Qnil) + if (NIL_P(num_adv)) return Qnil; ias.fd = fptr->fd; @@ -7868,10 +7872,11 @@ do_io_advise(rb_io_t *fptr, VALUE advice, off_t offset, off_t len) ias.len = len; rv = (int)rb_thread_io_blocking_region(io_advise_internal, &ias, fptr->fd); - if (rv) + if (rv) { /* posix_fadvise(2) doesn't set errno. On success it returns 0; otherwise it returns the error code. */ rb_syserr_fail(rv, RSTRING_PTR(fptr->pathv)); + } return Qnil; } @@ -7956,7 +7961,7 @@ rb_io_advise(int argc, VALUE *argv, VALUE io) #ifdef HAVE_POSIX_FADVISE return do_io_advise(fptr, advice, off, l); #else - /* Ignore all hint */ + ((void)off, (void)l); /* Ignore all hint */ return Qnil; #endif } |