From b526738c3b27bc67a3e1017a051aab1163a34117 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 5 Dec 2011 09:57:00 +0000 Subject: * 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 --- io.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 0f0bed7b9b..8f149db837 100644 --- a/io.c +++ b/io.c @@ -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 } -- cgit v1.2.3