diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-21 20:34:55 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-21 20:34:55 -0500 |
| commit | cd5f4de2a684ab0a3383ff328516243a6e850201 (patch) | |
| tree | a421b07b96689a975091f941e94f0d3f3bac0740 /lib/std/event/loop.zig | |
| parent | bf1cbebea1fd846c982e568ef4f013dfaf232e3e (diff) | |
| download | zig-cd5f4de2a684ab0a3383ff328516243a6e850201.tar.gz zig-cd5f4de2a684ab0a3383ff328516243a6e850201.zip | |
std: remove O_LARGEFILE from OS bits when the OS does not define it
Diffstat (limited to 'lib/std/event/loop.zig')
| -rw-r--r-- | lib/std/event/loop.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/event/loop.zig b/lib/std/event/loop.zig index 8f01c19746..44174c862c 100644 --- a/lib/std/event/loop.zig +++ b/lib/std/event/loop.zig @@ -856,7 +856,8 @@ pub const Loop = struct { }, .Close => |*msg| noasync os.close(msg.fd), .WriteFile => |*msg| blk: { - const flags = os.O_LARGEFILE | os.O_WRONLY | os.O_CREAT | + const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; + const flags = O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_TRUNC; const fd = noasync os.openC(msg.path.ptr, flags, msg.mode) catch |err| { msg.result = err; |
