main: fix logic bug when not specifying a timeout option
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
2cc4b998ec
commit
c79ef22285
1 changed files with 2 additions and 4 deletions
6
main.c
6
main.c
|
@ -74,7 +74,7 @@ int main(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
exec_timeout = strtol(optarg, NULL, 0);
|
exec_timeout = 1000 * strtol(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -82,13 +82,11 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exec_timeout < 1 || exec_timeout > 600) {
|
if (exec_timeout < 1000 || exec_timeout > 600000) {
|
||||||
fprintf(stderr, "Invalid execution timeout specified\n");
|
fprintf(stderr, "Invalid execution timeout specified\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
exec_timeout *= 1000;
|
|
||||||
|
|
||||||
if (stat(RPC_UCI_DIR_PREFIX, &s))
|
if (stat(RPC_UCI_DIR_PREFIX, &s))
|
||||||
mkdir(RPC_UCI_DIR_PREFIX, 0700);
|
mkdir(RPC_UCI_DIR_PREFIX, 0700);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue