commit 08f4478902d4357c8ded641e250d50abadea27c1 from: Omar Polo date: Thu Jul 07 13:40:32 2022 UTC use got_privsep_flush_imsg instead of reinventing it ok stsp@ commit - 8f137979fc5e284a136cf8950e8b3895d7ea208b commit + 08f4478902d4357c8ded641e250d50abadea27c1 blob - dbbc9b38387c388c49654f106cab82c723f3dd06 blob + 703c22b84de200f2a0ec9fc0f7bdc70dc725ab20 --- lib/patch.c +++ lib/patch.c @@ -100,12 +100,7 @@ send_patch(struct imsgbuf *ibuf, int fd) return err; } - if (imsg_flush(ibuf) == -1) { - err = got_error_from_errno("imsg_flush"); - imsg_clear(ibuf); - } - - return err; + return got_privsep_flush_imsg(ibuf); } static void blob - a48a4df951d4896c4fd29a461f3c17002b01bc3e blob + 73996be84412da8b6da8967a3b861c8e404900d5 --- libexec/got-read-patch/got-read-patch.c +++ libexec/got-read-patch/got-read-patch.c @@ -92,9 +92,7 @@ send_patch_done(void) if (imsg_compose(&ibuf, GOT_IMSG_PATCH_DONE, 0, 0, -1, NULL, 0) == -1) return got_error_from_errno("imsg_compose GOT_IMSG_PATCH_EOF"); - if (imsg_flush(&ibuf) == -1) - return got_error_from_errno("imsg_flush"); - return NULL; + return got_privsep_flush_imsg(&ibuf); } /* based on fetchname from usr.bin/patch/util.c */