From 87939bf8311c0e7d168741fe57bc8fac414811d8 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 13 Mar 2012 00:25:53 -0700 Subject: [PATCH] XQuartz: Move our logs into an X11 subdirectory Signed-off-by: Jeremy Huddleston --- hw/xquartz/darwin.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index a0ce377b1..2e5285a5a 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -650,9 +651,14 @@ OsVendorInit(void) char *home = getenv("HOME"); assert(home); - assert(0 < - asprintf(&lf, "%s/Library/Logs/%s.X11.log", home, - bundle_id_prefix)); + + /* Ignore errors. If EEXIST, we don't care. If anything else, + * LogInit will handle it for us. + */ + (void)mkdir(lf, S_IRWXU | S_IRWXG | S_IRWXO); + free(lf); + + assert(0 < asprintf(&lf, "%s/Library/Logs/X11/%s.log", home, bundle_id_prefix)); LogInit(lf, ".old"); free(lf);