diff options
Diffstat (limited to 'pm-suspend.c')
-rw-r--r-- | pm-suspend.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pm-suspend.c b/pm-suspend.c index 5ff5abe..cb382c5 100644 --- a/pm-suspend.c +++ b/pm-suspend.c @@ -4,8 +4,14 @@ int main(int argc, char **argv) { FILE *f = fopen("/sys/power/state", "w"); + if(argc != 2) { + fprintf(stderr, "%s [mem|standby|freeze|disk]\n", argv[0]); + exit(1); + } + + if(f == NULL) { - printf("%s is unable to write to /sys/power/state.\nAdd the setuid bit?\n", argv[0]); + fprintf(stderr, "%s is unable to write to /sys/power/state.\nAdd the setuid bit?\n", argv[0]); exit(1); } |