From: Auke Kok Date: Mon, 2 Apr 2012 18:02:34 +0000 (-0700) Subject: Move Xauth to just after env(). Stop creating ~/.xsession-errors. X-Git-Tag: v2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1dd63b129169e9a03f62fe3674dd6b6f96036b60;p=platform%2Fupstream%2Fxorg-launch-helper.git Move Xauth to just after env(). Stop creating ~/.xsession-errors. All log output just goes into the journal. --- diff --git a/src/main.c b/src/main.c index 19161c1..9471653 100644 --- a/src/main.c +++ b/src/main.c @@ -108,8 +108,6 @@ int main(int argc, char **argv) set_tty(); - setup_xauth(); - setup_pam_session(); switch_to_user(); diff --git a/src/user.c b/src/user.c index 69fb089..8d06414 100644 --- a/src/user.c +++ b/src/user.c @@ -143,6 +143,8 @@ void switch_to_user(void) ret = chdir(pass->pw_dir); + setup_xauth(); + fp = fopen(user_xauth_path, "w"); if (fp) { if (XauWriteAuth(fp, &x_auth) != 1) @@ -150,18 +152,6 @@ void switch_to_user(void) fclose(fp); } - /* redirect further IO to .xsession-errors */ - snprintf(fn, PATH_MAX, "%s/.xsession-errors", pass->pw_dir); - fp = fopen(fn, "w"); - if (fp) { - fclose(fp); - /* xserver.c already truncates this file, so append */ - fp = freopen(fn, "a", stdout); - fp = freopen(fn, "a", stderr); - } else { - lprintf("Unable to open \"%s\n\" for writing", fn); - } - d_out(); } diff --git a/src/xserver.c b/src/xserver.c index 9ed7fc8..32b7fe5 100644 --- a/src/xserver.c +++ b/src/xserver.c @@ -304,17 +304,6 @@ void start_X_server(void) } lprintf("starting X server with: \"%s\"", all); - /* redirect further IO to .xsession-errors */ - snprintf(fn, PATH_MAX, "%s/.xsession-errors", pass->pw_dir); - fp = fopen(fn, "w"); - if (fp) { - fclose(fp); - fp = freopen(fn, "w", stdout); - fp = freopen(fn, "w", stderr); - } else { - lprintf("Unable to open \"%s\n\" for writing", fn); - } - execv(ptrs[0], ptrs); d_out();