Skip to content

Commit e6f74b7

Browse files
committed
std: define error set of toPosixPath
1 parent ec24655 commit e6f74b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/std/dynamic_library.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ pub const WindowsDynLib = struct {
414414
};
415415

416416
pub const DlDynLib = struct {
417-
pub const Error = error{FileNotFound};
417+
pub const Error = error{ FileNotFound, NameTooLong };
418418

419419
handle: *anyopaque,
420420

lib/std/os.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5979,7 +5979,7 @@ pub fn sched_getaffinity(pid: pid_t) SchedGetAffinityError!cpu_set_t {
59795979

59805980
/// Used to convert a slice to a null terminated slice on the stack.
59815981
/// TODO https://github.com/ziglang/zig/issues/287
5982-
pub fn toPosixPath(file_path: []const u8) ![MAX_PATH_BYTES - 1:0]u8 {
5982+
pub fn toPosixPath(file_path: []const u8) error{NameTooLong}![MAX_PATH_BYTES - 1:0]u8 {
59835983
if (std.debug.runtime_safety) assert(std.mem.indexOfScalar(u8, file_path, 0) == null);
59845984
var path_with_null: [MAX_PATH_BYTES - 1:0]u8 = undefined;
59855985
// >= rather than > to make room for the null byte

0 commit comments

Comments
 (0)