Commit Diff


commit - 50a30d2587f76dbcf46418eac2d2cd13142a824e
commit + 05a4f4a0af5e31da8e41dd543270f06d69049fec
blob - 4e8558a2c12882b7b51a30cefb9e409a9cd97108
blob + ba221999c7b6668040ddb05ddc2222e3c61a86d3
--- gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c
+++ gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c
@@ -194,13 +194,10 @@ dispatch_gotd(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
+		} else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 2ef3416d43f078a9e1f325a27741297131f8e5e8
blob + 5ad3f11f5e1c3703357d07a810461d0edd4338cd
--- gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c
+++ gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c
@@ -488,13 +488,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 &&
+		} else if (imsgbuf_queuelen(ibuf) == 0 &&
 		    groupadd_state == GROUPADD_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
blob - 50a2fee49f2b2af0c8e57f5b73a1e771eb6ee5ee
blob + b44b7d433b08727fea3c50ffd0d2a044463d775d
--- gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c
+++ gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c
@@ -104,13 +104,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
+		} else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - a04e2181d5fd9608e10138adda56779ffd5d6e11
blob + 5324dcff325d1f5c40ba91b6387a18bb0756afaf
--- gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c
+++ gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c
@@ -172,13 +172,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
+		} else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 0989075072b148cbd55533f55e987d9cfbe3f9f9
blob + 06cd0a8b6e99fa0a70e3f77c25f06dd45f74e542
--- gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c
+++ gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c
@@ -150,13 +150,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 &&
+		} else if (imsgbuf_queuelen(ibuf) == 0 &&
 		    rmkeys_state == RMKEYS_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
blob - c4b01162c91455d2b1f77ad8078a8878d130525d
blob + 8a0ff30a244348cbe60c6d401f852572ae86d04e
--- gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c
+++ gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c
@@ -145,13 +145,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
+		} else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - c170ba07f64bc55989149a288a06309d7c1882ae
blob + aebb0290f632e8d3ca1b392ea97c9ac34354fdfa
--- gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
+++ gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
@@ -742,13 +742,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 &&
+		} else if (imsgbuf_queuelen(ibuf) == 0 &&
 		    useradd_state == USERADD_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
blob - 665a64bec1868de45b0c57de68ad240bc49cc7fb
blob + 67d66efcc5b2a413319624cb83ba50a31d6583f2
--- gotsysd/libexec/gotsys-userhome/gotsys-userhome.c
+++ gotsysd/libexec/gotsys-userhome/gotsys-userhome.c
@@ -216,13 +216,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 &&
+		} else if (imsgbuf_queuelen(ibuf) == 0 &&
 		    userhome_state == USERHOME_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
blob - f0151d0367d14d07acf1b831f3adcd574fdbe288
blob + 7edea2411607e0e48f19eef23eaeb963035288dd
--- gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c
+++ gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c
@@ -150,13 +150,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
+		} else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 315eb87b385e8dcb1ed88d46b428a5667016ec8e
blob + 7af2e2c8c1f8fc768f8b6b89978e40b5d796ab6e
--- gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c
+++ gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c
@@ -379,13 +379,10 @@ dispatch_event(int fd, short event, void *arg)
 	}
 
 	if (event & EV_WRITE) {
-		err = gotsysd_imsg_flush(ibuf);
-		if (err) {
-			warn("%s", err->msg);
+		if (imsgbuf_flush(ibuf) == -1) {
+			warn("imsgbuf_flush");
 			goto fatal;
-		}
-
-		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
+		} else if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;