Rename sleep_ms to sleep_us
The variable name was misleading, as we didn't calculate the time to sleep in milliseconds, but in microseconds.
This commit is contained in:
parent
368026d4b4
commit
5404c11700
1 changed files with 3 additions and 3 deletions
6
rdo.c
6
rdo.c
|
@ -47,7 +47,7 @@ void runprog(char** program_argv) {
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
char username[64], wrong_pw_sleep[64], session_ttl[64], password[128];
|
char username[64], wrong_pw_sleep[64], session_ttl[64], password[128];
|
||||||
unsigned int sleep_ms, tries, ts_ttl;
|
unsigned int sleep_us, tries, ts_ttl;
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
printf("RootDO version: %s\n\n", VERSION);
|
printf("RootDO version: %s\n\n", VERSION);
|
||||||
|
@ -70,7 +70,7 @@ int main(int argc, char** argv) {
|
||||||
getconf(fp, "username", username, sizeof(username));
|
getconf(fp, "username", username, sizeof(username));
|
||||||
getconf(fp, "wrong_pw_sleep", wrong_pw_sleep, sizeof(wrong_pw_sleep));
|
getconf(fp, "wrong_pw_sleep", wrong_pw_sleep, sizeof(wrong_pw_sleep));
|
||||||
getconf(fp, "session_ttl", session_ttl, sizeof(session_ttl));
|
getconf(fp, "session_ttl", session_ttl, sizeof(session_ttl));
|
||||||
sleep_ms = atoi(wrong_pw_sleep) * 1000;
|
sleep_us = atoi(wrong_pw_sleep) * 1000;
|
||||||
ts_ttl = atoi(session_ttl) * 60;
|
ts_ttl = atoi(session_ttl) * 60;
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
@ -111,7 +111,7 @@ int main(int argc, char** argv) {
|
||||||
runprog(&argv[1]);
|
runprog(&argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(sleep_ms);
|
usleep(sleep_us);
|
||||||
fprintf(stderr, "Wrong password.\n");
|
fprintf(stderr, "Wrong password.\n");
|
||||||
tries++;
|
tries++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue