mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
openbsd: mutex or cond destroy function could return EINVAL
This commit is contained in:
parent
8784c7b581
commit
9d306e5c77
@ -109,9 +109,12 @@ const PosixEvent = struct {
|
||||
}
|
||||
|
||||
fn deinit(self: *PosixEvent) void {
|
||||
// on dragonfly, *destroy() functions can return EINVAL
|
||||
// on dragonfly or openbsd, *destroy() functions can return EINVAL
|
||||
// for statically initialized pthread structures
|
||||
const err = if (builtin.os.tag == .dragonfly) os.EINVAL else 0;
|
||||
const err = if (builtin.os.tag == .dragonfly or builtin.os.tag == .openbsd)
|
||||
os.EINVAL
|
||||
else
|
||||
0;
|
||||
|
||||
const retm = c.pthread_mutex_destroy(&self.mutex);
|
||||
assert(retm == 0 or retm == err);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user