Commit Diff


commit - e215b807ba3c0b3e54a5ea161e750ac3466a1b0e
commit + dab315a53201f10e04361d5f740a7e921260d60c
blob - 82486de5473461070b3bc25188144766e945a929
blob + d319c0e84ab629196caf5ef768c81856c9626e77
--- lib/patch.c
+++ lib/patch.c
@@ -97,12 +97,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 - fa98b905970c2644ac714da07924df54c6939cc7
blob + 6e060722d52bf435497a80ec376c1496c81a2647
--- libexec/got-read-patch/got-read-patch.c
+++ libexec/got-read-patch/got-read-patch.c
@@ -91,9 +91,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 */