blob: 5ff5abe465109016a6fe503fe384ebf9f1c5caa1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
FILE *f = fopen("/sys/power/state", "w");
if(f == NULL) {
printf("%s is unable to write to /sys/power/state.\nAdd the setuid bit?\n", argv[0]);
exit(1);
}
fprintf(f, "%s", argv[1]);
fclose(f);
}
|