|
1 | 1 | #![allow(missing_docs, nonstandard_style)] |
2 | 2 |
|
3 | | -use crate::ffi::CStr; |
4 | 3 | use crate::io::ErrorKind; |
5 | 4 |
|
6 | 5 | pub use self::rand::hashmap_random_keys; |
@@ -75,7 +74,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { |
75 | 74 | // thread-id for the main thread and so renaming the main thread will rename the |
76 | 75 | // process and we only want to enable this on platforms we've tested. |
77 | 76 | if cfg!(target_os = "macos") { |
78 | | - thread::Thread::set_name(&CStr::from_bytes_with_nul_unchecked(b"main\0")); |
| 77 | + thread::Thread::set_name(&c"main"); |
79 | 78 | } |
80 | 79 |
|
81 | 80 | unsafe fn sanitize_standard_fds() { |
@@ -121,7 +120,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { |
121 | 120 | if pfd.revents & libc::POLLNVAL == 0 { |
122 | 121 | continue; |
123 | 122 | } |
124 | | - if open64("/dev/null\0".as_ptr().cast(), libc::O_RDWR, 0) == -1 { |
| 123 | + if open64(c"/dev/null".as_ptr().cast(), libc::O_RDWR, 0) == -1 { |
125 | 124 | // If the stream is closed but we failed to reopen it, abort the |
126 | 125 | // process. Otherwise we wouldn't preserve the safety of |
127 | 126 | // operations on the corresponding Rust object Stdin, Stdout, or |
@@ -151,7 +150,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { |
151 | 150 | use libc::open64; |
152 | 151 | for fd in 0..3 { |
153 | 152 | if libc::fcntl(fd, libc::F_GETFD) == -1 && errno() == libc::EBADF { |
154 | | - if open64("/dev/null\0".as_ptr().cast(), libc::O_RDWR, 0) == -1 { |
| 153 | + if open64(c"/dev/null".as_ptr().cast(), libc::O_RDWR, 0) == -1 { |
155 | 154 | // If the stream is closed but we failed to reopen it, abort the |
156 | 155 | // process. Otherwise we wouldn't preserve the safety of |
157 | 156 | // operations on the corresponding Rust object Stdin, Stdout, or |
|
0 commit comments