diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-07-10 19:18:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-07-10 19:21:47 +0900 |
commit | c8d0470bb0888bcb6719ba536e5f3f6a8b6551bb (patch) | |
tree | 98536f216cd90b7987629c95b8d2f03f2ec9a3e6 /io.c | |
parent | 092c9b266ab3175c40a78e8af99bb82a0f3d2f4b (diff) | |
download | ruby-c8d0470bb0888bcb6719ba536e5f3f6a8b6551bb.tar.gz |
Use `File::NULL` instead of hard coded null device names
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -5256,7 +5256,7 @@ rb_io_close_on_exec_p(VALUE io) * * Sets a close-on-exec flag. * - * f = open("/dev/null") + * f = File.open(File::NULL) * f.close_on_exec = true * system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory * f.closed? #=> false @@ -9634,11 +9634,11 @@ rb_io_autoclose_p(VALUE io) * * Sets auto-close flag. * - * f = open("/dev/null") + * f = File.open(File::NULL) * IO.for_fd(f.fileno).close * f.gets # raises Errno::EBADF * - * f = open("/dev/null") + * f = File.open(File::NULL) * g = IO.for_fd(f.fileno) * g.autoclose = false * g.close |