summaryrefslogtreecommitdiff
path: root/os
AgeCommit message (Collapse)AuthorFilesLines
2010-06-06Replace deprecated bzero with memsetMikhail Gusarov5-9/+9
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-19Make WriteEventsToClient/WriteToClient no-op on fake or dead clients.Jamey Sharp1-3/+5
This matches the test in TryClientEvents, and is a superset of tests done by the callers of these functions. The consequence of forgetting these tests is a server crash, so they're always desirable. In my opinion, it's better to not require the callers to remember to do these checks. For callers that don't do very much work before calling WriteToClient or WriteEventsToClient, I've removed the redundant checks. hw/xquartz/xpr/appledri.c has an interesting case: While its check for "client == NULL" appears redundant with the test in WriteEventsToClient, it dereferences client to get the sequence number. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497 Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-16XQuartz: Fix a build failure on TigerJeremy Huddleston1-0/+7
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-05-14Fix compiler issues with getifaddrs() call on OpenSolarisAlan Coopersmith1-5/+4
OpenSolaris recently added support for the getifaddrs() API. Building with that uncovered two compiler issues (one warning, one error) in the code that was now being built for the first time in our builds: "access.c", line 768: warning: argument #1 is incompatible with prototype: prototype: pointer to struct sockaddr {unsigned short sa_family, array[14] of char sa_data} : "access.c", line 213 argument : pointer to struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2} "access.c", line 838: assignment type mismatch: struct sockaddr {unsigned short sa_family, array[14] of char sa_data} "=" struct sockaddr_storage {unsigned short ss_family, array[6] of char _ss_pad1, double _ss_align, array[240] of char _ss_pad2} Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-13Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURNJeremy Huddleston1-1/+1
Use the values from xproto rather than duplicating the effort Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Introduce X_NORETURN macro defined as __attribute__((noreturn)) for gccMikhail Gusarov1-3/+2
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Turn sprintf argument into literaral string, shutting up gcc warningMikhail Gusarov1-3/+2
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Removed outdated comments obsoleted by documentation in headersMikhail Gusarov1-27/+0
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Use lowercase variant of XNFalloc and XstrdupMikhail Gusarov1-1/+1
Using one variant of function/macro makes it easier to fix the code later. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov12-112/+112
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggageMikhail Gusarov1-64/+44
C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so stop fiddling with alignment manually and just pass the arguments to library functions. Also convert silent error when negative size is passed into function into warning in log file. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-07Constify function prototypes in auth & xdmcp codeAlan Coopersmith7-58/+60
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21Merge remote branch 'vignatti/for-keith'Keith Packard1-3/+0
Conflicts: exa/exa.c Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21Death to Multibuffer extensionTiago Vignatti1-3/+0
The rationale behind is because no sane application will use this when we have modern APIs such DRI2. Besides, as a fact, xfree86 server has already deprecated this extension in 1998: http://www.xfree86.org/3.3.6/isc7.html Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-04-19unifdef -B -DRENDER to always include RENDER codeKeith Packard1-8/+0
This patch was created with: git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-15XQuartz: Fix possible NULL dereference in ListenOnOpenFDJeremy Huddleston1-2/+3
<rdar://problem/7862319> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Marc Majka <majka@apple.com>
2010-04-01darwin: Correct inline assembly for ___crashreporter_info__Jeremy Huddleston1-1/+1
It was missing an underscore. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-03-29darwin: Generate crash reports on FatalError()Jeremy Huddleston2-0/+11
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Acked-by: Adam Jackson <ajax@redhat.com>
2010-03-25os: Prevent backtrace from being stopped in noreturn functions.Rami Ylimaki1-5/+12
There are two noreturn functions in the X server: FatalError and AbortServer. Having any of those two functions in the middle of a call stack will prevent unwinding the program properly and stops the backtrace at those functions in gdb. The file containing FatalError and AbortServer, os/log.c, has to be compiled with the -mapcs-frame option on ARM to get proper backtraces. Automake imposes its own restrictions on compiling individual source files with different options. The recommended way to do this is to put os/log.c into a convenience library and add this library inside os/libos.la. See the documentation of GNU Automake manual, version 1.11.1, section 27.8 Per-Object Flags Emulation, for details. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-22New header for XF86Bigfont server functionsYaakov Selkowitz1-2/+1
Xext/xf86bigfont.c contains three non-static functions which are called elsewhere in the server. This creates a new header containing these declarations in order to fix several warnings: xf86bigfont.c:285: warning: no previous prototype for `XF86BigfontFreeFontShm' dixfonts.c:502: warning: implicit declaration of function `XF86BigfontFreeFontS$ dixfonts.c:502: warning: nested extern declaration of `XF86BigfontFreeFontShm' log.c:436: warning: implicit declaration of function `XF86BigfontCleanup' log.c:436: warning: nested extern declaration of `XF86BigfontCleanup' Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-03-16Xming: Warning fixesColin Harrison1-1/+1
Fix warnings due to prototypes not specifying function arguments Fix warning with RegQueryValueEx() Tidy up an include Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2010-03-11os: remove INTERNAL_MALLOC define.Peter Hutterer1-3/+0
There doesn't seem to be anything that defines it and given that the counterpart (the X internal malloc) was removed in 01cfba75229f4b9bf1e4fe80814931acdacde14c it's unlikely to work anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-17os: Prevent core dump from being truncated.Rami Ylimaki1-2/+2
The problem fixed by this patch can be reproduced on Linux with the following steps. - Access NULL pointer intentionally in ProcessOtherEvent on key press. - Instead of saving core dump to a file, write it into a pipe. echo "|/usr/sbin/my-core-dumper" > /proc/sys/kernel/core_pattern - Dump the core by pressing a key. While the core is being dumped into the pipe, the smart schedule timer will cause a pending SIGALRM. Linux kernel stops writing data to the pipe when there are pending signals. This causes the core dump to be truncated. On my system I'm expecting a 6 MB dump but the size will be 60 kB instead. The problem is solved if we block the SIGALRM caused by expired smart schedule timer. I haven't been able to reproduce this problem in the following cases. - Save core dump to a file instead of a pipe. - kill -SEGV `pidof Xorg` - Press a key to dump core while gdb is attached to Xorg. - Give option -dumbSched to Xorg. Also note that the fix works only when NoTrapSignals has the default value FALSE. The problem can still be reproduced if error signals aren't trapped. In addition to pending SIGALRM, there is a similar problem with pending SIGIO from the keyboard driver during core dump. Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-17os: Introduce OsAbort for proper core dumps.Rami Ylimaki1-0/+12
Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-02-12Merge remote branch 'jturney/master'Keith Packard1-4/+0
2010-02-11Add xstrtokenize to the dix.Peter Hutterer1-0/+40
Move tokenize out of the parser, make it a dix util function instead. Splitting a string into multiple substrings is useful by other places, so let's use it across the line. Future users include config/hal, config/udev and of course the parser. Example usage: char **substrings = xstrtokenize(my_string, "\n"); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-02-05Repair '-nolock'Jon TURNEY1-4/+0
commit 446fe9eecddd1337f9d5164dd7c301e1ba3dfe32 removes the AC_DEFINE for SERVER_LOCK and conditional compilation checking it, making it always on everywhere, except in os/utils.c where code is left under SERVER_LOCK, which now never gets built, making the '-nolock' option non-functional... This seems to have been broken since Xserver 1.7.0, but this option is actually of some slight use on cygwin, as if /tmp resides on a FAT filesystem (yes, I know...), hard links aren't supported. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-01-27xserver: Add timestamps to logfile output.Kok, Auke1-0/+9
Add timestamps in seconds derived from clock_monotonic to the log file. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-25Remove unbalanced ( from failure to move log errorAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-01-11os: state effect of -a and -t options more preciselySimon Thum1-2/+2
Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-16Merge remote branch 'alanc/master'Keith Packard1-1/+23
2009-12-16os: print log markers only if log level is >= 0Tiago Vignatti1-11/+11
FWIW default log verbosity is 0, so this will affect only if one start the server with a different -verbose argument. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-16Update Sun license notices to current X.Org standard formAlan Coopersmith1-1/+23
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-08Miscellaneous compilation warning fixesJeremy Huddleston1-2/+2
main.c:134: warning: no previous prototype for 'dix_main' rootlessScreen.c: In function 'RootlessMarkOverlappedWindows': rootlessScreen.c:434: warning: function declaration isn't a prototype backtrace.c:51: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int' backtrace.c:54: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'int' set.c: In function 'RecordSetMemoryRequirements': set.c:413: warning: old-style function definition set.c: In function 'RecordCreateSet': set.c:425: warning: old-style function definition stub.c: In function ‘main’: stub.c:236: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-11-11.gitignore: use common defaults with custom section #24239Gaetan Nadon1-0/+2
Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. Reviewed-By: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-09Avoid a null dereference if IFF_BROADCAST is set but there is no broadcast ↵Jon TURNEY1-1/+2
address It seems that the getifaddrs() function can return interfaces with IFF_BROADCAST & IFF_UP set, but no broadcast address (at least under Cygwin 1.7, this seems to happen for v6 mapped v4 addresses) Avoid a null dereference if this ever happens Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2009-11-05SHA1: Add support for Common CryptoJeremy Huddleston1-0/+28
libSystem on darwin can handle SHA1 computation without needing to pull in OpenSSL. See CC_crypto(3) Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
2009-11-02add libc as a choice for SHA1 implementationMatthieu Herrb1-1/+2
On Sun, Nov 01, 2009 at 02:54:13PM -0800, Keith Packard wrote: > Excerpts from Matthieu Herrb's message of Sun Nov 01 09:34:35 -0800 2009: > > > +AC_CHECK_FUNCS([SHA1Init], [HAVE_LIBC_SHA1=yes]) > > I'd suggest AC_CHECK_FUNC instead; as far as I can tell, AC_CHECK_FUNCS > will also define HAVE_SHA1INIT. Also, can you use HAVE_LIBC_SHA1 > consistently rather than having two separate names (HAVE_LIBC_SHA1 and > HAVE_SHA1_IN_LIBC)? Yes, I know one is a preprocessor symbol and the > other is a cpp shell variable, but I think that will work anyway. > New version taking you comments into account. From: Matthieu Herrb <matthieu.herrb@laas.fr> Date: Sun, 1 Nov 2009 18:19:27 +0100 Subject: [PATCH] Add a probe for SHA1 functions in libc in *BSD. The interface is the same as the one in libmd. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-29Supply all code using dl*() with DLOPEN_LIBSMikhail Gusarov1-1/+1
Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-28os: Add libsha1 as a choice of SHA1 implementationMikhail Gusarov1-0/+26
There are small systems which don't need OpenSSL or gcrypt. Add libsha1 (http://github.com/dottedmag/libsha1) as an alternative small SHA1 implementation. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-15Add libgcrypt as an option for SHA1Julien Cristau1-0/+39
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rémi Cardona <remi@gentoo.org>
2009-10-15Move SHA1 computation from render/glyph.c to os/Julien Cristau2-1/+77
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rémi Cardona <remi@gentoo.org>
2009-10-08Fix GCC warnings in xorg_backtraceJamey Sharp1-3/+3
Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-10-06Use $(AM_V_GEN) to silence more commands when AM_SILENT_RULES is activeAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-06Add platform tests for Dtrace linker magicAlan Coopersmith1-3/+1
Replaces special handling for Xquartz DDX and scales better to handling the multiple platforms that now have some level of Dtrace support available. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2009-09-27Add (ok, fix) support for DTrace under OS XBen Byer1-0/+2
(cherry picked from commit 8428a57184f542941d2c8c90e97d18e111a69dd2)
2009-09-04os: silence bigreqsproto compiler warningPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-04os: don't redefine GNU_SOURCEPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-28os: remove unused -cursor optionTiago Vignatti1-5/+0
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-20linux: Yet more malloc() avoidance for backtrace()Adam Jackson1-0/+14
Turns out, there's an initializer at the top of backtrace() that (on some arches) calls dlopen(). dlopen(), unsurprisingly, calls malloc(). So, call backtrace() early in signal handler setup so we can later safely call it from the signal handler itself.