/* -*-c-*-
*
- * $Id: sw_build.c,v 1.1 1999/06/02 16:53:34 mdw Exp $
+ * $Id: sw_build.c,v 1.2 1999/07/16 12:50:24 mdw Exp $
*
* Management of build processes
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sw_build.c,v $
- * Revision 1.1 1999/06/02 16:53:34 mdw
- * Initial revision
+ * Revision 1.2 1999/07/16 12:50:24 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:34 mdw
+ * Initial import.
*
*/
int ok = 1;
if (r->sz != 1) {
r->buf[r->sz] = 0;
- dstr_putf(&d, "\nTerminated by signal: %s.\n", r->buf);
+ dstr_putf(&d, "failed (%s)", r->buf);
ok = 0;
rc = 1;
} else if (r->buf[0]) {
- dstr_putf(&d, "\nExited with status %u.\n",
- (unsigned char)r->buf[0]);
+ dstr_putf(&d, "failed (status %u)", (unsigned char)r->buf[0]);
ok = 0;
rc = 1;
- } else if (opt_flags & optFlag_install)
- e->flags |= archFlag_built;
- if (d.len)
- p->output(e, d.buf, d.len);
- dstr_destroy(&d);
+ } else {
+ dstr_puts(&d, "finished");
+ if (opt_flags & optFlag_install)
+ e->flags |= archFlag_built;
+ }
if (p->close)
- p->close(e, ok);
+ p->close(e, ok, d.buf);
+ dstr_destroy(&d);
FD_CLR(r->fdin, &fdin);
close(r->fdin);
active--;
} break;
case PKTYPE_EOF: {
- const static char msg[] = "\nUnexpected exit.\n";
- p->output(e, msg, sizeof(msg) - 1);
if (p->close)
- p->close(e, 0);
+ p->close(e, 0, "unexpected exit");
rc = 1;
FD_CLR(r->fdin, &fdin);
close(r->fdin);
p->abort(a);
switch (exc_type) {
case EXC_ERRNO:
- die(1, "unexpected error: %s", exc_i);
+ die(1, "unexpected error: %s", strerror(exc_i));
break;
default:
RETHROW;