summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorp4bl0 <r _at_ uzy .dot. me>2016-02-16 23:24:01 (CET)
committerp4bl0 <r _at_ uzy .dot. me>2016-02-16 23:24:01 (CET)
commit439e77e832e16a82ad74ed0b342b42e0f796292c (patch)
tree0086b9f0f00a290035cdba63679b617104750607
parentd7dafc9b629a59e938f6fb9904f4acc01ea0c630 (diff)
downloadmyutils-439e77e832e16a82ad74ed0b342b42e0f796292c.zip
myutils-439e77e832e16a82ad74ed0b342b42e0f796292c.tar.gz
fixes
-rw-r--r--autologinonce.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/autologinonce.c b/autologinonce.c
index 098e1fd..4031841 100644
--- a/autologinonce.c
+++ b/autologinonce.c
@@ -5,25 +5,25 @@
int
main (int argc, char *argv[])
{
- double uptime;
+ int uptime;
FILE *_proc_uptime = fopen("/proc/uptime", "r");
if (_proc_uptime == NULL) {
perror("autologinonce");
exit(EXIT_FAILURE);
}
- fscanf(_proc_uptime, "%f", &uptime);
+ fscanf(_proc_uptime, "%d", &uptime);
fclose(_proc_uptime);
- if (uptime < 10.0) {
+ if (uptime < 60) {
execl("/sbin/agetty", "/sbin/agetty",
"--autologin", "p4bl0",
- "--noclear", "%I", "38400", "linux",
+ "--noclear", "tty1", "38400", "linux",
NULL);
}
execl("/sbin/agetty", "/sbin/agetty",
- "--noclear", "%I", "38400", "linux",
+ "--noclear", "tty1", "38400", "linux",
NULL);
return EXIT_FAILURE;
Pablo Rauzy — generated by cgit