summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-11-22 16:25:39 +0100
committerJo-Philipp Wich <jo@mein.io>2018-11-22 16:25:39 +0100
commitc79ef222858abf65a7d6fc5f869ec45385dd9021 (patch)
tree0a84a02440265ca946bdc60a223a4976673dc7a2
parent2cc4b998ec78fc8fb9e12a5e67e71c34b2511719 (diff)
downloadrpcd-c79ef222858abf65a7d6fc5f869ec45385dd9021.tar.gz
main: fix logic bug when not specifying a timeout option
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.c b/main.c
index b246997..4ea5f2c 100644
--- a/main.c
+++ b/main.c
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
break;
case 't':
- exec_timeout = strtol(optarg, NULL, 0);
+ exec_timeout = 1000 * strtol(optarg, NULL, 0);
break;
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");
return -1;
}
- exec_timeout *= 1000;
-
if (stat(RPC_UCI_DIR_PREFIX, &s))
mkdir(RPC_UCI_DIR_PREFIX, 0700);