Commit e93cd8287a8164af8da813d5d1f764e7b68ed244

Stefan Sperling 2018-11-11T15:03:21

fix imsg_compose() error check in got_privsep_send_error()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/privsep.c b/lib/privsep.c
index 3cea78f..a43947c 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -162,7 +162,7 @@ got_privsep_send_error(struct imsgbuf *ibuf, const struct got_error *err)
 	else
 		ierr.errno_code = 0;
 	ret = imsg_compose(ibuf, GOT_IMSG_ERROR, 0, 0, -1, &ierr, sizeof(ierr));
-	if (ret != -1) {
+	if (ret == -1) {
 		fprintf(stderr, "%s: error %d \"%s\": imsg_compose: %s\n",
 		    getprogname(), err->code, err->msg, strerror(errno));
 		return;