Skip to contentSkip to conversation

Provide -h flag when calling shutdown (8) from rtcwake.

PATCH New Ángel González 1 participant 1 message Apr 6, 2015 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Provide -h flag when calling shutdown (8) from rtcwake.

Otherwise, when calling rtcwake -m off you get:
"shutdown: -H and -P flags can only be used along with -h flag." accompanied by the shutdown usage, instead of a halt.

---
 sys-utils/rtcwake.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sys-utils/rtcwake.c +2 -1
index 0e16bd3..a8c2424 100644
@@ -561,13 +561,14 @@ int main(int argc, char **argv)
 		dryrun = 1;	/* to skip disabling alarm at the end */
 
 	} else if (strcmp(suspend, "off") == 0) {
-		char *arg[4];
+		char *arg[5];
 		int i = 0;
 
 		if (verbose)
 			printf(_("suspend mode: off; executing %s\n"),
 						_PATH_SHUTDOWN);
 		arg[i++] = _PATH_SHUTDOWN;
+		arg[i++] = "-h";
 		arg[i++] = "-P";
 		arg[i++] = "now";
 		arg[i]   = NULL;
Signature · 1 line
1.7.11.5