From: Mathieu Desnoyers Date: Thu, 1 Oct 2009 03:18:04 +0000 (-0400) Subject: Fix liblttctl closedir X-Git-Tag: 0.80~21 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=22acd9c7dda2c48c4a161aa39b5a598fef4f6310;p=ltt-control.git Fix liblttctl closedir Here's my patch to liblttctl.c so it compiles and runs using uClibc. I'm using Linux 2.6.30. Sincerely, Scott Esters, AF6RT scott@af6rt.com Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttctl/liblttctl.c b/liblttctl/liblttctl.c index 6ee37a4..6d49aeb 100644 --- a/liblttctl/liblttctl.c +++ b/liblttctl/liblttctl.c @@ -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) {