Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce4615d
)
libcom_err: handle error case when FD_CLOEXEC can't be set on debug FILE
author
Theodore Ts'o
<tytso@mit.edu>
Sat, 23 Jun 2018 03:21:34 +0000
(23:21 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Sat, 23 Jun 2018 21:23:32 +0000
(17:23 -0400)
Fixes-Coverity-Bug: 1049142
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/et/error_message.c
patch
|
blob
|
history
diff --git
a/lib/et/error_message.c
b/lib/et/error_message.c
index
5dd8aa6
..
bd18be7
100644
(file)
--- a/
lib/et/error_message.c
+++ b/
lib/et/error_message.c
@@
-257,7
+257,14
@@
static void init_debug(void)
if (fd >= 0) {
flags = fcntl(fd, F_GETFD);
if (flags >= 0)
- fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+ flags = fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+ if (flags < 0) {
+ fprintf(debug_f, "Couldn't set FD_CLOEXEC "
+ "on debug FILE: %s\n", strerror(errno));
+ fclose(debug_f);
+ debug_f = NULL;
+ debug_mask = DEBUG_INIT;
+ }
}
#endif
} else