X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-crash%2Flttng-crash.c;h=4d186dd557fb995ecbfd3b29f8637d63110b59d2;hp=c3a8b778925d1de9bed8d191b1eec1324f982d2b;hb=920a187eae9f63e109072acde16d009b01dc95c3;hpb=b742e3e20470f98be1c1fda6d0c5b3346e19d6e8 diff --git a/src/bin/lttng-crash/lttng-crash.c b/src/bin/lttng-crash/lttng-crash.c index c3a8b7789..4d186dd55 100644 --- a/src/bin/lttng-crash/lttng-crash.c +++ b/src/bin/lttng-crash/lttng-crash.c @@ -1062,12 +1062,14 @@ int delete_trace(const char *trace_path) trace_dir = opendir(trace_path); if (!trace_dir) { PERROR("Cannot open '%s' path", trace_path); - return -1; + ret = -errno; + goto end; } trace_dir_fd = dirfd(trace_dir); if (trace_dir_fd < 0) { PERROR("dirfd"); - return -1; + ret = -errno; + goto end; } while ((entry = readdir(trace_dir))) {