Skip to content

Instantly share code, notes, and snippets.

@floppym
Created July 26, 2023 18:42
Show Gist options
  • Save floppym/0e0e029c93b61c7089620d023fb5798c to your computer and use it in GitHub Desktop.
Save floppym/0e0e029c93b61c7089620d023fb5798c to your computer and use it in GitHub Desktop.
stdin
diff --git a/src/halt.c b/src/halt.c
index a469147..1d4b6ed 100644
--- a/src/halt.c
+++ b/src/halt.c
@@ -162,8 +162,8 @@ void do_shutdown(char *fl, int should_poweroff, char *tm)
args[i++] = "shutdown";
args[i++] = fl;
- if ( (! strcmp(fl, "-h") ) && (should_poweroff) )
- args[i++] = "-P";
+ if (!strcmp(fl, "-h"))
+ args[i++] = (should_poweroff ? "-P" : "-H");
if (tm) {
args[i++] = "-t";
args[i++] = tm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment