diff options
Diffstat (limited to 'std')
| -rw-r--r-- | std/dynamic_library.zig | 7 | ||||
| -rw-r--r-- | std/math/index.zig | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/std/dynamic_library.zig b/std/dynamic_library.zig index 87b58ec207..8fe5f7f818 100644 --- a/std/dynamic_library.zig +++ b/std/dynamic_library.zig @@ -12,13 +12,8 @@ pub const DynLib = struct { map_size: usize, /// Trusts the file - pub fn findAndOpen(allocator: *mem.Allocator, name: []const u8) !DynLib { - return open(allocator, name); - } - - /// Trusts the file pub fn open(allocator: *mem.Allocator, path: []const u8) !DynLib { - const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY); + const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC); errdefer std.os.close(fd); const size = usize((try std.os.posixFStat(fd)).size); diff --git a/std/math/index.zig b/std/math/index.zig index 8c1dcc32c4..99e5b4ecf1 100644 --- a/std/math/index.zig +++ b/std/math/index.zig @@ -538,7 +538,7 @@ test "math.cast" { pub const AlignCastError = error{UnalignedMemory}; -/// Align cast a pointer but return an error if it's the wrong field +/// Align cast a pointer but return an error if it's the wrong alignment pub fn alignCast(comptime alignment: u29, ptr: var) AlignCastError!@typeOf(@alignCast(alignment, ptr)) { const addr = @ptrToInt(ptr); if (addr % alignment != 0) { |
