aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-10 19:18:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-10 19:21:47 +0900
commitc8d0470bb0888bcb6719ba536e5f3f6a8b6551bb (patch)
tree98536f216cd90b7987629c95b8d2f03f2ec9a3e6 /io.c
parent092c9b266ab3175c40a78e8af99bb82a0f3d2f4b (diff)
downloadruby-c8d0470bb0888bcb6719ba536e5f3f6a8b6551bb.tar.gz
Use `File::NULL` instead of hard coded null device names
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io.c b/io.c
index c3661a90a7..0eb8da3f4f 100644
--- a/io.c
+++ b/io.c
@@ -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