X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=08e6ee0d8f895591c995023ffe1292dc5040b773;hp=d45707b763deaf653b3ed75f65c80a3f5ed42b55;hb=67f8cb8d6212bc14f5c4a35f34e01c4f631c0d6e;hpb=5f98d630e06cc5c89e8601b12be6d70fb7f8093d diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index d45707b76..08e6ee0d8 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -254,8 +254,8 @@ int get_stream_shm_path(char *stream_shm_path, const char *shm_path, int cpu) strncpy(stream_shm_path, shm_path, PATH_MAX); stream_shm_path[PATH_MAX - 1] = '\0'; ret = snprintf(cpu_nr, UINT_MAX_STR_LEN, "%u", cpu); - if (ret != 1) { - ret = -1; + if (ret < 0) { + PERROR("snprintf"); goto end; } strncat(stream_shm_path, cpu_nr,