commit - 1be0a2761223329d982a83674908b3a58f8790a5
commit + eed75362a5ea63dce575b27a7891b3390ea52bdb
blob - 39be115836d70a90186dd39b811dea75652428b7
blob + 33a2cdbf89c83c0d7ffda564b38bdddd601d8f8d
--- script.c
+++ script.c
}
imsg_close(&ibuf, buf);
-
-#if DEBUG
- {
- void *data = TAILQ_FIRST(&ibuf.w.bufs)->buf;
- size_t len = TAILQ_FIRST(&ibuf.w.bufs)->size;
- hexdump("IMSG_BUF", data, len);
- }
-#endif
if (imsg_flush(&ibuf) == -1) {
i = errno;
return EVAL_ERR;
}
+nextmessage:
/* read only one message */
if ((n = imsg_get(&ibuf, &imsg)) == -1)
fatal("imsg_get");
imsg_free(&imsg);
return EVAL_ERR;
+ case IMSG_MSIZE:
+ imsg_free(&imsg);
+ goto nextmessage;
+
default:
before_printing();
printf("got unknown message from subprocess: %d\n",
prepare_child_for_test(t);
ret = eval(t->body);
+ imsg_compose(&ibuf, IMSG_CONN_GONE, 0, 0, -1, NULL, 0);
+ imsg_flush(&ibuf);
+
while (waitpid(pid, NULL, 0) != pid)
; /* nop */