From 7cd970786d72a68b735f33904bdded6c8aebdf33 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 21 Aug 2012 07:54:32 +0200 Subject: xserver xkeyboard-config mesa pixman git update 21 Aug 2012 --- xorg-server/hw/xfree86/common/xf86Module.h | 2 +- xorg-server/hw/xquartz/X11Controller.m | 62 ++++++++++++++++++++++- xorg-server/hw/xquartz/console_redirect.c | 28 ++++++---- xorg-server/hw/xquartz/mach-startup/bundle-main.c | 17 +++++++ xorg-server/xkeyboard-config/symbols/us | 2 +- 5 files changed, 96 insertions(+), 15 deletions(-) (limited to 'xorg-server') diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h index d93405e3c..83f9790d2 100644 --- a/xorg-server/hw/xfree86/common/xf86Module.h +++ b/xorg-server/hw/xfree86/common/xf86Module.h @@ -82,7 +82,7 @@ typedef enum { #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(13, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(18, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(6, 0) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(7, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 diff --git a/xorg-server/hw/xquartz/X11Controller.m b/xorg-server/hw/xquartz/X11Controller.m index 393bc1abe..737db42e7 100644 --- a/xorg-server/hw/xquartz/X11Controller.m +++ b/xorg-server/hw/xquartz/X11Controller.m @@ -53,6 +53,11 @@ #include #include #include +#include +#include + +extern aslclient aslc; +extern char *bundle_id_prefix; @implementation X11Controller @@ -342,9 +347,12 @@ const char *newargv[4]; char buf[128]; char *s; +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + int stdout_pipe[2]; + int stderr_pipe[2]; +#endif - newargv[0] = - [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"]; + newargv[0] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"]; newargv[1] = "-c"; newargv[2] = [filename UTF8String]; newargv[3] = NULL; @@ -355,6 +363,40 @@ setenv("DISPLAY", buf, TRUE); } +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + if (asl_log_descriptor) { + char *asl_sender; + aslmsg amsg = asl_new(ASL_TYPE_MSG); + assert(amsg); + + asprintf(&asl_sender, "%s.%s", bundle_id_prefix, newargv[2]); + assert(asl_sender); + for(s = asl_sender + strlen(bundle_id_prefix) + 1; *s; s++) { + if(! ((*s >= 'a' && *s <= 'z') || + (*s >= 'A' && *s <= 'Z') || + (*s >= '0' && *s <= '9'))) { + *s = '_'; + } + } + + (void)asl_set(amsg, ASL_KEY_SENDER, asl_sender); + free(asl_sender); + + assert(0 == pipe(stdout_pipe)); + fcntl(stdout_pipe[0], F_SETFD, FD_CLOEXEC); + fcntl(stdout_pipe[0], F_SETFL, O_NONBLOCK); + + assert(0 == pipe(stderr_pipe)); + fcntl(stderr_pipe[0], F_SETFD, FD_CLOEXEC); + fcntl(stderr_pipe[0], F_SETFL, O_NONBLOCK); + + asl_log_descriptor(aslc, amsg, ASL_LEVEL_INFO, stdout_pipe[0], ASL_LOG_DESCRIPTOR_READ); + asl_log_descriptor(aslc, amsg, ASL_LEVEL_NOTICE, stderr_pipe[0], ASL_LOG_DESCRIPTOR_READ); + + asl_free(amsg); + } +#endif + /* Do the fork-twice trick to avoid having to reap zombies */ child1 = fork(); switch (child1) { @@ -371,6 +413,14 @@ _exit(1); case 0: /* child2 */ +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + if (asl_log_descriptor) { + /* Replace our stdout/stderr */ + dup2(stdout_pipe[1], STDOUT_FILENO); + dup2(stderr_pipe[1], STDERR_FILENO); + } +#endif + /* close all open files except for standard streams */ max_files = sysconf(_SC_OPEN_MAX); for (i = 3; i < max_files; i++) @@ -391,6 +441,14 @@ default: /* parent */ waitpid(child1, &status, 0); } + +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + if (asl_log_descriptor) { + /* Close the write ends of the pipe */ + close(stdout_pipe[1]); + close(stderr_pipe[1]); + } +#endif } - (void) app_selected:sender diff --git a/xorg-server/hw/xquartz/console_redirect.c b/xorg-server/hw/xquartz/console_redirect.c index 91d693b67..8fdce4699 100644 --- a/xorg-server/hw/xquartz/console_redirect.c +++ b/xorg-server/hw/xquartz/console_redirect.c @@ -110,27 +110,33 @@ _read_redirect(int fd, int flush) /* Increment our returned number read */ total_read += nbytes; - nbytes += (aslr->w - aslr->buf); - aslr->buf[nbytes] = '\0'; + /* Increment our write location */ + aslr->w += nbytes; + aslr->w[0] = '\0'; /* One line at a time */ - for (p = aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) { + for (p = aslr->buf; p < aslr->w; p = s + 1) { // Find null or \n for (s = p; *s && *s != '\n'; s++) ; if (*s == '\n') { *s = '\0'; + } + + if (s < aslr->w || aslr->buf == p) { + /* Either the first of multiple messages or one message which is larger than our buffer */ asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); } - else if (aslr->buf != p) { + else { + /* We reached the end of the buffer, move this chunk to the start. */ memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf)); aslr->w = aslr->buf + (s - p); break; } - else if (nbytes == BUF_SIZE - 1) { - asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); - aslr->w = aslr->buf; - break; - } + } + + if (p == aslr->w) { + /* Start writing at the beginning in the case where we flushed */ + aslr->w = aslr->buf; } } @@ -359,8 +365,8 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) BLOCK_DONE; } redirect_fds = new_array; - memset(redirect_fds + n_redirect_fds, 0, new_n - - n_redirect_fds); + memset(redirect_fds + n_redirect_fds, 0, (new_n - + n_redirect_fds) * sizeof(*redirect_fds)); n_redirect_fds = new_n; } diff --git a/xorg-server/hw/xquartz/mach-startup/bundle-main.c b/xorg-server/hw/xquartz/mach-startup/bundle-main.c index cabdf1eab..b40366244 100644 --- a/xorg-server/hw/xquartz/mach-startup/bundle-main.c +++ b/xorg-server/hw/xquartz/mach-startup/bundle-main.c @@ -563,8 +563,25 @@ setup_console_redirect(const char *bundle_id) free(asl_facility); asl_set_filter(aslc, ASL_FILTER_MASK_UPTO(ASL_LEVEL_WARNING)); + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +# if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + if (asl_log_descriptor) +# endif + { + asl_log_descriptor(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO, ASL_LOG_DESCRIPTOR_WRITE); + asl_log_descriptor(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO, ASL_LOG_DESCRIPTOR_WRITE); + } +# if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + else { + xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO); + xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO); + } +# endif +#else xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO); xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO); +#endif } static void diff --git a/xorg-server/xkeyboard-config/symbols/us b/xorg-server/xkeyboard-config/symbols/us index 91e78a5ce..2d54e28cc 100644 --- a/xorg-server/xkeyboard-config/symbols/us +++ b/xorg-server/xkeyboard-config/symbols/us @@ -1290,7 +1290,7 @@ xkb_symbols "intl-unicode" { // abovedot, caron key { [ period, greater, U0307, U030C ] }; // hook - key { [ slash, question, questiondown, 0309 ] }; + key { [ slash, question, questiondown, U0309 ] }; // alt-intl compatibility // cedilla, caron -- cgit v1.2.3