authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-31 11:18:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-31 11:18:15-07:00
log6bb776bb7392ee0a9f6a19989505985255ec98d2
treee3794f18957d3b16587e950142067fa3292030a5
parentddd7b0ea9e15f3ef154c06cc2aa975ff28bbecec

Revert "std.os: selfExePath implementation for haiku"

This reverts commit 7439eb5e99ba98bbdb2a0d0d71535e57d13f3c6e.

1 files changed, 1 insertions(+), 10 deletions(-)

lib/std/fs.zig+1-10
...@@ -2934,7 +2934,6 @@ pub const OpenSelfExeError = error{...@@ -2934,7 +2934,6 @@ pub const OpenSelfExeError = error{
2934 /// On Windows, file paths cannot contain these characters:2934 /// On Windows, file paths cannot contain these characters:
2935 /// '/', '*', '?', '"', '<', '>', '|'2935 /// '/', '*', '?', '"', '<', '>', '|'
2936 BadPathName,2936 BadPathName,
2937 Overflow,
2938 Unexpected,2937 Unexpected,
2939} || os.OpenError || SelfExePathError || os.FlockError;2938} || os.OpenError || SelfExePathError || os.FlockError;
29402939
...@@ -3014,15 +3013,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {...@@ -3014,15 +3013,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
3014 // TODO could this slice from 0 to out_len instead?3013 // TODO could this slice from 0 to out_len instead?
3015 return mem.sliceTo(out_buffer, 0);3014 return mem.sliceTo(out_buffer, 0);
3016 },3015 },
3017 .haiku => {3016 .openbsd, .haiku => {
3018 // The only possible issue when looking for the self image path is
3019 // when the buffer is too short.
3020 // TODO replace with proper constants
3021 if (os.find_path(null, 1000, null, out_buffer.ptr, out_buffer.len) != 0)
3022 return error.Overflow;
3023 return mem.sliceTo(out_buffer, 0);
3024 },
3025 .openbsd => {
3026 // OpenBSD doesn't support getting the path of a running process, so try to guess it3017 // OpenBSD doesn't support getting the path of a running process, so try to guess it
3027 if (os.argv.len == 0)3018 if (os.argv.len == 0)
3028 return error.FileNotFound;3019 return error.FileNotFound;