From: Alan Cox Date: Sun, 22 Oct 2017 21:06:44 +0000 (+0100) Subject: reboot: add user side support for reboot -f X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4596a57c2af730cd197846dc1f88de7c21f268df;p=FUZIX.git reboot: add user side support for reboot -f --- diff --git a/Applications/util/reboot.c b/Applications/util/reboot.c index 90f92bc7..6cff3eb7 100644 --- a/Applications/util/reboot.c +++ b/Applications/util/reboot.c @@ -8,15 +8,25 @@ int main(int argc, char *argv[]) { + int pv = 0; char *p = strchr(argv[0], '/'); if (p) p++; else p = argv[0]; + if (argc == 2 && strcmp(argv[1], "-f") == 0) { + argc--; + pv = AD_NOSYNC; + } + if (argc != 1) { + write(2, "unexpected argument.\n", 21); + exit(1); + } + if (strcmp(p, "halt") == 0) - uadmin(A_SHUTDOWN,0,0); + uadmin(A_SHUTDOWN, pv, 0); else - uadmin(A_REBOOT,0,0); + uadmin(A_REBOOT, pv, 0); /* If we get here there was an error! */ perror(argv[0]); return 1;