diff options
author | Andreas Boll <andreas.boll.dev@gmail.com> | 2013-09-11 14:27:08 +0200 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2013-09-27 15:29:54 -0700 |
commit | faec15dc7a5dfed7ffd3399331a3ce601f73cdc0 (patch) | |
tree | 46a7a7f1060c15b2d35500b0c510cbc3183eb4f4 | |
parent | 5461cc1f00dc9a06c94d05b0096e95e14652b013 (diff) |
os: First check for __GLIBC__ and then for PIPE_OS_BSD
Fixes FTBFS on kfreebsd-*
Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h
from glibc. Instead it provides program_invocation_short_name from glibc.
You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 32637f56a5422b09ad945d21d8e60a8b990b0182)
-rw-r--r-- | src/gallium/auxiliary/os/os_process.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/os/os_process.c b/src/gallium/auxiliary/os/os_process.c index 0557689322..ef38e1d689 100644 --- a/src/gallium/auxiliary/os/os_process.c +++ b/src/gallium/auxiliary/os/os_process.c @@ -32,10 +32,10 @@ #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) # include <windows.h> -#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) -# include <stdlib.h> #elif defined(__GLIBC__) # include <errno.h> +#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) +# include <stdlib.h> #else #warning unexpected platform in os_process.c #endif @@ -68,11 +68,11 @@ os_get_process_name(char *procname, size_t size) name = lpProcessName; +#elif defined(__GLIBC__) + name = program_invocation_short_name; #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) /* *BSD and OS X */ name = getprogname(); -#elif defined(__GLIBC__) - name = program_invocation_short_name; #else #warning unexpected platform in os_process.c return FALSE; |