summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2012-03-13 00:25:53 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-03-27 11:50:44 -0700
commitcdd704da190da8e6b15bb3dae81f84ce1535bff8 (patch)
treeb637ec8a7da8faa84e9a9091b6e536502254b80f
parent5926ed85a1e2cb873f9e0950cfe21510b6c94d6f (diff)
XQuartz: Move our logs into an X11 subdirectory
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commit 87939bf8311c0e7d168741fe57bc8fac414811d8)
-rw-r--r--hw/xquartz/darwin.c12
1 files 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 <sys/types.h>
#include <sys/time.h>
+#include <sys/stat.h>
#include <sys/syslimits.h>
#include <stdio.h>
#include <fcntl.h>
@@ -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);