# HG changeset patch # User Mychaela Falconia # Date 1616360300 0 # Node ID 812779459ddd83cc0526bbe85c1e437a5484d194 # Parent fbedb67d234fd11acf5835af138849849583643c Calypso exit mode: show any output from back end diff -r fbedb67d234f -r 812779459ddd libcommon/exit.c --- a/libcommon/exit.c Sun Mar 21 20:46:09 2021 +0000 +++ b/libcommon/exit.c Sun Mar 21 20:58:20 2021 +0000 @@ -4,14 +4,23 @@ #include extern unsigned calypso_fd; -extern FILE *cpipeF; +extern FILE *cpipeF, *rpipeF; + +calypso_poweroff() +{ + int c; + + fputs("poweroff\n", cpipeF); + fflush(cpipeF); + while ((c = getc(rpipeF)) != EOF) + putchar(c); + exit(0); +} good_exit() { - if (calypso_fd) { - fputs("poweroff\n", cpipeF); - fflush(cpipeF); - } + if (calypso_fd) + calypso_poweroff(); exit(0); } @@ -27,11 +36,8 @@ } if (!strcmp(argv[1], "bare")) exit(0); - if (!strcmp(argv[1], "iota-off")) { - fputs("poweroff\n", cpipeF); - fflush(cpipeF); - exit(0); - } + if (!strcmp(argv[1], "iota-off")) + calypso_poweroff(); fprintf(stderr, "error: \"%s\" is not an understood exit mode\n", argv[1]); return(-1);