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{
29342934 /// On Windows, file paths cannot contain these characters:
29352935 /// '/', '*', '?', '"', '<', '>', '|'
29362936 BadPathName,
2937 Overflow,
29382937 Unexpected,
29392938} || os.OpenError || SelfExePathError || os.FlockError;
29402939
......@@ -3014,15 +3013,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
30143013 // TODO could this slice from 0 to out_len instead?
30153014 return mem.sliceTo(out_buffer, 0);
30163015 },
3017 .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 => {
3016 .openbsd, .haiku => {
30263017 // OpenBSD doesn't support getting the path of a running process, so try to guess it
30273018 if (os.argv.len == 0)
30283019 return error.FileNotFound;