diff options
author | Mattias Andrée <maandree@kth.se> | 2021-02-01 17:41:31 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-02-01 17:41:31 +0100 |
commit | 6e48590a4b26fad71d6a0b3320f59d696dbcdeb5 (patch) | |
tree | c134d9e4b9c13deb7ec181be18a18344d9843f3b /asroot.c | |
parent | Fix exit value (diff) | |
download | asroot-6e48590a4b26fad71d6a0b3320f59d696dbcdeb5.tar.gz asroot-6e48590a4b26fad71d6a0b3320f59d696dbcdeb5.tar.bz2 asroot-6e48590a4b26fad71d6a0b3320f59d696dbcdeb5.tar.xz |
Add customisation instructions to config.mk, rename ERROR_SLEEP to RETRY_SLEEP, and remove sleep instruction if RETRY_SLEEP is nonpositive
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'asroot.c')
-rw-r--r-- | asroot.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -20,8 +20,8 @@ #define EXIT_EXEC 126 #define EXIT_NOENT 127 -#ifndef ERROR_SLEEP -# define ERROR_SLEEP 1 +#ifndef RETRY_SLEEP +# define RETRY_SLEEP 1 #endif #ifndef PROMPT @@ -342,7 +342,9 @@ again: if (strcmp(got, expected)) { fprintf(stderr, "%s: incorrect password, please try again\n", argv0); tcsetattr(fd, TCSAFLUSH, &stty_sleep); - sleep(ERROR_SLEEP); +#if RETRY_SLEEP > 0 + sleep(RETRY_SLEEP); +#endif tcsetattr(fd, TCSAFLUSH, &stty_enter); goto again; } |