- if (status != OK) {
- if (did_message == 0) {
- if ((hook = context_find("msg-hook")) != (char *)0)
- advise(NULL, hook);
- else
- advise(NULL, "external hook (%s) did not work properly.", hook);
-
- did_message = 1;
- }
-
- return (NOTOK);
+ if (status == OK)
+ return OK;
+
+ if (did_message == 0) {
+ char *msghook;
+ if ((msghook = context_find("msg-hook")) != NULL)
+ inform("%s", msghook);
+ else {
+ char errbuf[BUFSIZ];
+ snprintf(errbuf, sizeof(errbuf), "external hook \"%s\"", hook);
+ pidstatus(status, stderr, errbuf);
+ }
+ did_message = 1;