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);