authorgravatar for semarie@online.frSébastien Marie <semarie@online.fr> 2020-11-10 05:26:35+00:00
committergravatar for semarie@online.frSébastien Marie <semarie@online.fr> 2020-11-10 05:26:35+00:00
log9d306e5c77b19fdb8a211f5460d4fd4a7d1fb915
tree8a132bc2fc5d933da2338fb45d1d494faf4dc448
parent8784c7b581b8a21c3698c4564e2a912676adaa2e

openbsd: mutex or cond destroy function could return EINVAL


1 files changed, 5 insertions(+), 2 deletions(-)

lib/std/reset_event.zig+5-2
......@@ -109,9 +109,12 @@ const PosixEvent = struct {
109109 }
110110
111111 fn deinit(self: *PosixEvent) void {
112 // on dragonfly, *destroy() functions can return EINVAL
112 // on dragonfly or openbsd, *destroy() functions can return EINVAL
113113 // for statically initialized pthread structures
114 const err = if (builtin.os.tag == .dragonfly) os.EINVAL else 0;
114 const err = if (builtin.os.tag == .dragonfly or builtin.os.tag == .openbsd)
115 os.EINVAL
116 else
117 0;
115118
116119 const retm = c.pthread_mutex_destroy(&self.mutex);
117120 assert(retm == 0 or retm == err);