Commit Diff


commit - 4f6bf13c6b1b46b405a7f093a1bc52bf247afb9d
commit + 326548fb2e3468c814229a7354f2cdc48b5a4676
blob - fac1c4f570df4862991d4f658c5a3c11a704dc7b
blob + 4e8558a2c12882b7b51a30cefb9e409a9cd97108
--- gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c
+++ gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c
@@ -200,7 +200,7 @@ dispatch_gotd(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
@@ -268,7 +268,7 @@ dispatch_gotsysd(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 8c62b3911bd2668fa3afe43c20fdebc836de8f20
blob + 2ef3416d43f078a9e1f325a27741297131f8e5e8
--- gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c
+++ gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c
@@ -494,7 +494,8 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (groupadd_state == GROUPADD_STATE_DONE) {
+		if (imsgbuf_queuelen(ibuf) == 0 &&
+		    groupadd_state == GROUPADD_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - d374b0683687ab88292b0c3c394ddbf6e3a389f0
blob + 50a2fee49f2b2af0c8e57f5b73a1e771eb6ee5ee
--- gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c
+++ gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c
@@ -110,7 +110,7 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - f1169eb5055e46b5b2694bd6b20fb7ee0f0570f7
blob + a04e2181d5fd9608e10138adda56779ffd5d6e11
--- gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c
+++ gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c
@@ -178,7 +178,7 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 49be7d867338ece2e569a1fdaffc698098429efc
blob + 0989075072b148cbd55533f55e987d9cfbe3f9f9
--- gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c
+++ gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c
@@ -156,7 +156,8 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (rmkeys_state == RMKEYS_STATE_DONE) {
+		if (imsgbuf_queuelen(ibuf) == 0 &&
+		    rmkeys_state == RMKEYS_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 7c78742c561ac370c30f6f28a3844f11e53d2279
blob + c4b01162c91455d2b1f77ad8078a8878d130525d
--- gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c
+++ gotsysd/libexec/gotsys-sshdconfig/gotsys-sshdconfig.c
@@ -151,7 +151,7 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 41cf26b122f2b7e4948081a7d3523211aa4cd99f
blob + c170ba07f64bc55989149a288a06309d7c1882ae
--- gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
+++ gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
@@ -748,7 +748,8 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (useradd_state == USERADD_STATE_DONE) {
+		if (imsgbuf_queuelen(ibuf) == 0 &&
+		    useradd_state == USERADD_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 85ffb48b610175195bc6fccdf7c94cba6d458279
blob + 665a64bec1868de45b0c57de68ad240bc49cc7fb
--- gotsysd/libexec/gotsys-userhome/gotsys-userhome.c
+++ gotsysd/libexec/gotsys-userhome/gotsys-userhome.c
@@ -222,7 +222,8 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (userhome_state == USERHOME_STATE_DONE) {
+		if (imsgbuf_queuelen(ibuf) == 0 &&
+		    userhome_state == USERHOME_STATE_DONE) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 49f4229d8d8f2b1ba74e21017e3092bf0064b9f7
blob + f0151d0367d14d07acf1b831f3adcd574fdbe288
--- gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c
+++ gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c
@@ -156,7 +156,7 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;
blob - 3224ceb6ed71f00cb8c64518e60e0a64557c78f6
blob + 315eb87b385e8dcb1ed88d46b428a5667016ec8e
--- gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c
+++ gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c
@@ -385,7 +385,7 @@ dispatch_event(int fd, short event, void *arg)
 			goto fatal;
 		}
 
-		if (flush_and_exit) {
+		if (imsgbuf_queuelen(ibuf) == 0 && flush_and_exit) {
 			event_del(&iev->ev);
 			event_loopexit(NULL);
 			return;