[PATCH weston] log: Open log file CLOEXEC so child processes don't get the fd

Derek Foreman derekf at osg.samsung.com
Thu Jun 4 08:54:10 PDT 2015


Uses a glibc extension to fopen(), but we seem ok with glibc
extensions elsewhere (such as printf %m)...

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/log.c b/src/log.c
index 99bbe18..ef9b54d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -75,7 +75,7 @@ weston_log_file_open(const char *filename)
 	wl_log_set_handler_server(custom_handler);
 
 	if (filename != NULL)
-		weston_logfile = fopen(filename, "a");
+		weston_logfile = fopen(filename, "ae");
 
 	if (weston_logfile == NULL)
 		weston_logfile = stderr;
-- 
2.1.4



More information about the wayland-devel mailing list