X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Frunas.c;h=5ab42717a9058b4a5083516aa142a3c1efda226d;hb=a0b439da54ed351640b74ade4de16db27338ddd1;hp=9029f8f74d7802416a97a5f22a0650da9378ce68;hpb=6cd525e813795a1d5e38feac8dedf2c73ffb1274;p=lttng-tools.git diff --git a/src/common/runas.c b/src/common/runas.c index 9029f8f74..5ab42717a 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -77,6 +77,20 @@ struct run_as_open_data { mode_t mode; }; +#ifdef VALGRIND +static +int use_clone(void) +{ + return 0; +} +#else +static +int use_clone(void) +{ + return !getenv("LTTNG_DEBUG_NOCLONE"); +} +#endif + /* * Create recursively directory using the FULL path. */ @@ -271,7 +285,7 @@ int run_as_noclone(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid) static int run_as(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid) { - if (!getenv("LTTNG_DEBUG_NOCLONE")) { + if (use_clone()) { int ret; DBG("Using run_as_clone");