treewide: rename exec_timeout to rpc_exec_timeout
[project/rpcd.git] / main.c
diff --git a/main.c b/main.c
index b24699765f92792824e3941d78e732aaff62b647..1db3241958f0d61ba01c59a5f6710b7d6839e58b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -33,7 +33,7 @@
 static struct ubus_context *ctx;
 static bool respawn = false;
 
-int exec_timeout = RPC_EXEC_DEFAULT_TIMEOUT;
+int rpc_exec_timeout = RPC_EXEC_DEFAULT_TIMEOUT;
 
 static void
 handle_signal(int sig)
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
                        break;
 
                case 't':
-                       exec_timeout = strtol(optarg, NULL, 0);
+                       rpc_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 (rpc_exec_timeout < 1000 || rpc_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);