treewide: rename exec_timeout to rpc_exec_timeout

Rename the extern int to denote a global symbol.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-11-28 12:07:58 +01:00
parent c79ef22285
commit ccd7c0af75
4 changed files with 6 additions and 6 deletions

2
exec.c
View file

@ -350,7 +350,7 @@ rpc_exec(const char **args, rpc_exec_write_cb_t in,
uloop_process_add(&c->process); uloop_process_add(&c->process);
c->timeout.cb = rpc_exec_timeout_cb; c->timeout.cb = rpc_exec_timeout_cb;
uloop_timeout_set(&c->timeout, exec_timeout); uloop_timeout_set(&c->timeout, rpc_exec_timeout);
if (c->stdin_cb) if (c->stdin_cb)
{ {

2
file.c
View file

@ -690,7 +690,7 @@ rpc_file_exec_run(const char *cmd,
uloop_process_add(&c->process); uloop_process_add(&c->process);
c->timeout.cb = rpc_file_exec_timeout_cb; c->timeout.cb = rpc_file_exec_timeout_cb;
uloop_timeout_set(&c->timeout, exec_timeout); uloop_timeout_set(&c->timeout, rpc_exec_timeout);
close(opipe[1]); close(opipe[1]);
close(epipe[1]); close(epipe[1]);

View file

@ -50,7 +50,7 @@
ustream_fd_init(&us, fd); \ ustream_fd_init(&us, fd); \
} while(0) } while(0)
extern int exec_timeout; extern int rpc_exec_timeout;
typedef int (*rpc_exec_write_cb_t)(struct ustream *, void *); typedef int (*rpc_exec_write_cb_t)(struct ustream *, void *);
typedef int (*rpc_exec_read_cb_t)(struct blob_buf *, char *, int, void *); typedef int (*rpc_exec_read_cb_t)(struct blob_buf *, char *, int, void *);

6
main.c
View file

@ -33,7 +33,7 @@
static struct ubus_context *ctx; static struct ubus_context *ctx;
static bool respawn = false; static bool respawn = false;
int exec_timeout = RPC_EXEC_DEFAULT_TIMEOUT; int rpc_exec_timeout = RPC_EXEC_DEFAULT_TIMEOUT;
static void static void
handle_signal(int sig) handle_signal(int sig)
@ -74,7 +74,7 @@ int main(int argc, char **argv)
break; break;
case 't': case 't':
exec_timeout = 1000 * strtol(optarg, NULL, 0); rpc_exec_timeout = 1000 * strtol(optarg, NULL, 0);
break; break;
default: default:
@ -82,7 +82,7 @@ int main(int argc, char **argv)
} }
} }
if (exec_timeout < 1000 || exec_timeout > 600000) { if (rpc_exec_timeout < 1000 || rpc_exec_timeout > 600000) {
fprintf(stderr, "Invalid execution timeout specified\n"); fprintf(stderr, "Invalid execution timeout specified\n");
return -1; return -1;
} }