X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Frunas.cpp;h=2c762d5ee797f3a98c92f1f59527a1a9ae92f37c;hb=f149493493fbd8a3efa4748832c03278c96c38ca;hp=6b1201deb6fc032c3dfb7cd4abcb7db6bd8e31fb;hpb=2d7da3031c65c4569ff2428a7c2cad30007f3b50;p=lttng-tools.git diff --git a/src/common/runas.cpp b/src/common/runas.cpp index 6b1201deb..2c762d5ee 100644 --- a/src/common/runas.cpp +++ b/src/common/runas.cpp @@ -43,10 +43,6 @@ #define GETPW_BUFFER_FALLBACK_SIZE 4096 -struct run_as_data; -struct run_as_ret; -typedef int (*run_as_fct)(struct run_as_data *data, struct run_as_ret *ret_value); - enum run_as_cmd { RUN_AS_MKDIR, RUN_AS_MKDIRAT, @@ -67,6 +63,11 @@ enum run_as_cmd { RUN_AS_GENERATE_FILTER_BYTECODE, }; +namespace { +struct run_as_data; +struct run_as_ret; +typedef int (*run_as_fct)(struct run_as_data *data, struct run_as_ret *ret_value); + struct run_as_mkdir_data { int dirfd; char path[LTTNG_PATH_MAX]; @@ -210,7 +211,7 @@ struct run_as_command_properties { bool use_cwd_fd; }; -static const struct run_as_command_properties command_properties[] = { +const struct run_as_command_properties command_properties[] = { { .in_fds_offset = offsetof(struct run_as_data, u.mkdir.dirfd), .out_fds_offset = -1, @@ -341,9 +342,10 @@ struct run_as_worker_data { }; /* Single global worker per process (for now). */ -static run_as_worker_data *global_worker; +run_as_worker_data *global_worker; /* Lock protecting the worker. */ -static pthread_mutex_t worker_lock = PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t worker_lock = PTHREAD_MUTEX_INITIALIZER; +} /* namespace */ #ifdef VALGRIND static