Fix liblttctl closedir
[ltt-control.git] / liblttctl / liblttctl.c
index 6ee37a479797d7f5f70d65446035c9c69588e354..6d49aeb37b440dc631376975ef1cac3acb2120d6 100644 (file)
@@ -162,6 +162,7 @@ static int lttctl_check_trace(const char *name, int expect)
        dir = opendir(tracedirname);
        if (dir) {
                exist = 1;
+               closedir(dir);
        } else {
                if (errno != ENOENT) {
                        fprintf(stderr, "%s: %s\n", __func__, strerror(errno));
@@ -170,8 +171,6 @@ static int lttctl_check_trace(const char *name, int expect)
                exist = 0;
        }
 
-       closedir(dir);
-
        if (!expect != !exist) {
                if (exist)
                {
This page took 0.023375 seconds and 4 git commands to generate.