Commit 6418f9ae91

LemonBoy <thatlemon@gmail.com>
2021-01-18 18:02:09
std: Add missing cast when calling fcntl w/ constant args
comptime_int arguments are a big no no.
1 parent f33bac2
Changed files (1)
lib
std
lib/std/os.zig
@@ -3780,7 +3780,7 @@ pub fn pipe2(flags: u32) PipeError![2]fd_t {
     // F_SETFD.
     if (flags & O_CLOEXEC != 0) {
         for (fds) |fd| {
-            switch (errno(system.fcntl(fd, F_SETFD, FD_CLOEXEC))) {
+            switch (errno(system.fcntl(fd, F_SETFD, @as(u32, FD_CLOEXEC)))) {
                 0 => {},
                 EINVAL => unreachable, // Invalid flags
                 EBADF => unreachable, // Always a race condition