X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=da93da1cc35078ec232bd0997d023509dec56807;hp=dafe085dc9bc40b81f53a35b13fbc6791969492f;hb=f11e84c2c33f6e2f4da8436012bcc61b3291b0d7;hpb=441c16a7f0bbab56a5e783059d0cddab68544a9a diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index dafe085dc..da93da1cc 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -41,6 +41,18 @@ static char sessiond_sock_path[PATH_MAX]; static char *tracing_group; static int connected; +/* Global */ + +/* + * Those two variables are used by error.h to silent or control the verbosity of + * error message. They are global to the library so application linking with it + * are able to compile correctly and also control verbosity of the library. + * + * Note that it is *not* possible to silent ERR() and PERROR() macros. + */ +int lttng_opt_quiet; +int lttng_opt_verbose; + /* * Copy string from src to dst and enforce null terminated byte. */ @@ -138,11 +150,8 @@ static int check_tracing_group(const char *grp_name) /* Get GID of group 'tracing' */ grp_tracing = getgrnam(grp_name); - if (grp_tracing == NULL) { - /* NULL means not found also. getgrnam(3) */ - if (errno != 0) { - perror("getgrnam"); - } + if (!grp_tracing) { + /* If grp_tracing is NULL, the group does not exist. */ goto end; }