io.c: unused assignments
* io.c (fptr_finalize_flush): removed unused assignments. if noraise, err is never used after set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
80477c1dff
commit
49e801c1c7
7
io.c
7
io.c
@ -4523,8 +4523,7 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl)
|
|||||||
}
|
}
|
||||||
if (fptr->wbuf.len) {
|
if (fptr->wbuf.len) {
|
||||||
if (noraise) {
|
if (noraise) {
|
||||||
if ((int)io_flush_buffer_sync(fptr) < 0 && NIL_P(err))
|
io_flush_buffer_sync(fptr);
|
||||||
err = Qtrue;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (io_fflush(fptr) < 0 && NIL_P(err))
|
if (io_fflush(fptr) < 0 && NIL_P(err))
|
||||||
@ -4543,7 +4542,7 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl)
|
|||||||
/* stdio_file is deallocated anyway
|
/* stdio_file is deallocated anyway
|
||||||
* even if fclose failed. */
|
* even if fclose failed. */
|
||||||
if ((maygvl_fclose(stdio_file, noraise) < 0) && NIL_P(err))
|
if ((maygvl_fclose(stdio_file, noraise) < 0) && NIL_P(err))
|
||||||
err = noraise ? Qtrue : INT2NUM(errno);
|
if (!noraise) err = INT2NUM(errno);
|
||||||
}
|
}
|
||||||
else if (0 <= fd) {
|
else if (0 <= fd) {
|
||||||
/* fptr->fd may be closed even if close fails.
|
/* fptr->fd may be closed even if close fails.
|
||||||
@ -4554,7 +4553,7 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl)
|
|||||||
keepgvl |= !(mode & FMODE_WRITABLE);
|
keepgvl |= !(mode & FMODE_WRITABLE);
|
||||||
keepgvl |= noraise;
|
keepgvl |= noraise;
|
||||||
if ((maygvl_close(fd, keepgvl) < 0) && NIL_P(err))
|
if ((maygvl_close(fd, keepgvl) < 0) && NIL_P(err))
|
||||||
err = noraise ? Qtrue : INT2NUM(errno);
|
if (!noraise) err = INT2NUM(errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NIL_P(err) && !noraise) {
|
if (!NIL_P(err) && !noraise) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user