Re: [systemd-devel] [systemd PATCH 2/2] Fix file descriptor leak in efi_get_variable()

2013-01-28 Thread Thomas Jarosch
On Friday, 25. January 2013 16:58:48 Lennart Poettering wrote: > > -if (fstat(fd, &st) < 0) > > +if (fstat(fd, &st) < 0) { > > +close_nointr_nofail(fd); > > I figure cppcheck needs to learn about _cleanup_close_... We use gcc's > cleanup attribute logic to close thi

[systemd-devel] [systemd PATCH 2/2] Fix file descriptor leak in efi_get_variable()

2013-01-25 Thread Thomas Jarosch
Detected by cppcheck. Signed-off-by: Thomas Jarosch --- src/shared/efivars.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/shared/efivars.c b/src/shared/efivars.c index d5cb88c..4402aec 100644 --- a/src/shared/efivars.c +++ b/src/shared

[systemd-devel] [systemd PATCH 1/2] Fix mismatching pipe close opened by popen()

2013-01-25 Thread Thomas Jarosch
cppcheck reported: [src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f Signed-off-by: Thomas Jarosch --- src/bootchart/svg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 156918a..550f769 100644

[systemd-devel] [PATCH] Fix file descriptor leak on error

2012-12-25 Thread Thomas Jarosch
Detected by cppcheck Signed-off-by: Thomas Jarosch --- src/tmpfiles/tmpfiles.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index c27d011..d8fb07e 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c

systemd-devel@lists.freedesktop.org

2011-11-09 Thread Thomas Jarosch
The code should probably look like the statements above it. Please verify, I just detected it using cppcheck. Signed-off-by: Thomas Jarosch --- src/unit.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unit.c b/src/unit.c index 903a8e4..c793b11 100644 --- a/src

[systemd-devel] [PATCH] Fix file descriptor leak in test_capability()

2011-10-26 Thread Thomas Jarosch
Detected by cppcheck. Signed-off-by: Thomas Jarosch --- src/condition.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/condition.c b/src/condition.c index f18c454..2b51a16 100644 --- a/src/condition.c +++ b/src/condition.c @@ -187,6 +187,8 @@ static bool

Re: [systemd-devel] systemd kills mdmon if it was started manually by user

2011-10-24 Thread Thomas Jarosch
On Sunday, 23. October 2011 10:00:36 Dan Williams wrote: > Is it time for a libmd.so, so systemd can invoke the "--wait-clean --scan" > process itself? Probably simpler to just SIGTERM mdmon and wait for it. The mdadm code makes good use of non-reentrant functions like ctime(), readdir() and oth

[systemd-devel] [PATCH 2/2] Fix close() call on wrong variable

2011-10-05 Thread Thomas Jarosch
Detected by "cppcheck" (actually it detected a file descriptor leak) Please CC: comments. Signed-off-by: Thomas Jarosch --- src/util.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index 7977ee4..ae9d9bd 100644 --- a/src/ut

[systemd-devel] [PATCH 1/2] Fix file descriptor leak

2011-10-05 Thread Thomas Jarosch
Detected by "cppcheck" Please CC: comments. Signed-off-by: Thomas Jarosch --- src/tmpfiles.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/tmpfiles.c b/src/tmpfiles.c index a6b8f85..21bf44d 100644 --- a/src/tmpfiles.c +++ b/src/tmpfiles.c @@ -15