|
From: Cyril H. <su...@li...> - 2013-04-02 10:21:29
|
The branch, master, has been updated
via 36b4a0e6cce5e4f1a92c7ae2073c00452bf40321 (commit)
from 33b0fe6194f8e7922ac3286bd5bbf6273b4a096b (commit)
- Log -----------------------------------------------------------------
commit 36b4a0e6cce5e4f1a92c7ae2073c00452bf40321
Author: Jan Stancek <jst...@re...>
Date: Tue Apr 2 11:42:59 2013 +0200
fixed leaked fds in setup/cleanup_proc_fs
Signed-off-by: Jan Stancek <jst...@re...>
-----------------------------------------------------------------------
Summary of changes:
testcases/kernel/syscalls/utils/common_j_h.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/testcases/kernel/syscalls/utils/common_j_h.c b/testcases/kernel/syscalls/utils/common_j_h.c
index 4c255ca..43165ca 100644
--- a/testcases/kernel/syscalls/utils/common_j_h.c
+++ b/testcases/kernel/syscalls/utils/common_j_h.c
@@ -296,6 +296,7 @@ int setup_proc_fs(char *path, int newval, int *oldval)
} while (rc < 0 && errno == EAGAIN);
if (rc < 0) {
EPRINTF("read failed.\n");
+ close(fd);
return -1;
}
@@ -303,6 +304,7 @@ int setup_proc_fs(char *path, int newval, int *oldval)
sprintf(buf, "%d\n", newval);
len = strlen(buf);
rc = write(fd, buf, len);
+ close(fd);
if (rc != len) {
EPRINTF("write failed.\n");
return -1;
@@ -324,6 +326,7 @@ int cleanup_proc_fs(char *path, int oldval)
sprintf(buf, "%d\n", oldval);
len = strlen(buf);
rc = write(fd, buf, len);
+ close(fd);
if (rc != len) {
EPRINTF("write failed.\n");
return -1;
hooks/post-receive
--
ltp
|