diff --git a/liblog/logd_write.c b/liblog/logd_write.c index d812abce9..3613d25f2 100644 --- a/liblog/logd_write.c +++ b/liblog/logd_write.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -37,7 +39,7 @@ #define log_writev(filedes, vector, count) fakeLogWritev(filedes, vector, count) #define log_close(filedes) fakeLogClose(filedes) #else -#define log_open(pathname, flags) open(pathname, flags) +#define log_open(pathname, flags) open(pathname, (flags) | O_CLOEXEC) #define log_writev(filedes, vector, count) writev(filedes, vector, count) #define log_close(filedes) close(filedes) #endif