summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorp4bl0 <r _at_ uzy .dot. me>2017-07-19 09:34:54 (CEST)
committerp4bl0 <r _at_ uzy .dot. me>2017-07-19 09:34:54 (CEST)
commit3a0e84c9ccc592207ee912ff75b138f752b9237b (patch)
tree23b2961b8923d256975709a22f36f7d7f7981d9f
parent01b697cbe454b4e4f6ba240ff8d5fc1f4e774373 (diff)
downloadmyutils-3a0e84c9ccc592207ee912ff75b138f752b9237b.zip
myutils-3a0e84c9ccc592207ee912ff75b138f752b9237b.tar.gz
change boot login detection strategy
-rw-r--r--autologinonce.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/autologinonce.c b/autologinonce.c
index 4031841..2a59f90 100644
--- a/autologinonce.c
+++ b/autologinonce.c
@@ -5,18 +5,21 @@
int
main (int argc, char *argv[])
{
- int uptime;
- FILE *_proc_uptime = fopen("/proc/uptime", "r");
- if (_proc_uptime == NULL) {
- perror("autologinonce");
- exit(EXIT_FAILURE);
- }
+ /* int uptime; */
+ /* FILE *_proc_uptime = fopen("/proc/uptime", "r"); */
+ /* if (_proc_uptime == NULL) { */
+ /* perror("autologinonce"); */
+ /* exit(EXIT_FAILURE); */
+ /* } */
+
+ /* fscanf(_proc_uptime, "%d", &uptime); */
- fscanf(_proc_uptime, "%d", &uptime);
+ /* fclose(_proc_uptime); */
- fclose(_proc_uptime);
+ /* if (uptime < 60) { */
- if (uptime < 60) {
+ if (access("/tmp/autologinonce", F_OK) < 0) {
+ creat("/tmp/autologinonce", 00400);
execl("/sbin/agetty", "/sbin/agetty",
"--autologin", "p4bl0",
"--noclear", "tty1", "38400", "linux",
Pablo Rauzy — generated by cgit