summaryrefslogtreecommitdiff
path: root/ext/io/nonblock
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-30 17:29:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-30 17:29:56 +0900
commit4ba2c66761d6a293abdfba409241d31063cefd62 (patch)
tree72d29ea142bfe440f0a38b1618f8204d60aea6cf /ext/io/nonblock
parent0d842fecb4f75ab3b1d4097ebdb8e88f51558041 (diff)
Revert "* expand tabs. [ci skip]"
This reverts commit 0d842fecb4f75ab3b1d4097ebdb8e88f51558041.
Diffstat (limited to 'ext/io/nonblock')
-rw-r--r--ext/io/nonblock/nonblock.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/io/nonblock/nonblock.c b/ext/io/nonblock/nonblock.c
index cbd43d993a..b8a40ff38e 100644
--- a/ext/io/nonblock/nonblock.c
+++ b/ext/io/nonblock/nonblock.c
@@ -42,7 +42,7 @@ rb_io_nonblock_p(VALUE io)
rb_io_t *fptr;
GetOpenFile(io, fptr);
if (get_fcntl_flags(fptr->fd) & O_NONBLOCK)
- return Qtrue;
+ return Qtrue;
return Qfalse;
}
#else
@@ -54,21 +54,21 @@ static void
set_fcntl_flags(int fd, int f)
{
if (fcntl(fd, F_SETFL, f) == -1)
- rb_sys_fail(0);
+ rb_sys_fail(0);
}
static int
io_nonblock_set(int fd, int f, int nb)
{
if (nb) {
- if ((f & O_NONBLOCK) != 0)
- return 0;
- f |= O_NONBLOCK;
+ if ((f & O_NONBLOCK) != 0)
+ return 0;
+ f |= O_NONBLOCK;
}
else {
- if ((f & O_NONBLOCK) == 0)
- return 0;
- f &= ~O_NONBLOCK;
+ if ((f & O_NONBLOCK) == 0)
+ return 0;
+ f &= ~O_NONBLOCK;
}
set_fcntl_flags(fd, f);
return 1;
@@ -127,9 +127,9 @@ rb_io_nonblock_set(VALUE io, VALUE nb)
rb_io_t *fptr;
GetOpenFile(io, fptr);
if (RTEST(nb))
- rb_io_set_nonblock(fptr);
+ rb_io_set_nonblock(fptr);
else
- io_nonblock_set(fptr->fd, get_fcntl_flags(fptr->fd), RTEST(nb));
+ io_nonblock_set(fptr->fd, get_fcntl_flags(fptr->fd), RTEST(nb));
return io;
}
@@ -160,15 +160,15 @@ rb_io_nonblock_block(int argc, VALUE *argv, VALUE io)
GetOpenFile(io, fptr);
if (argc > 0) {
- VALUE v;
- rb_scan_args(argc, argv, "01", &v);
- nb = RTEST(v);
+ VALUE v;
+ rb_scan_args(argc, argv, "01", &v);
+ nb = RTEST(v);
}
f = get_fcntl_flags(fptr->fd);
restore[0] = fptr->fd;
restore[1] = f;
if (!io_nonblock_set(fptr->fd, f, nb))
- return rb_yield(io);
+ return rb_yield(io);
return rb_ensure(rb_yield, io, io_nonblock_restore, (VALUE)restore);
}
#else