mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 12:50:10 +01:00
gallium/os: use util_get_process_name when possible
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
parent
2e1e6511f7
commit
7149bffe66
2 changed files with 4 additions and 14 deletions
|
|
@ -29,18 +29,13 @@
|
|||
#include "pipe/p_config.h"
|
||||
#include "os/os_process.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/process.h"
|
||||
|
||||
#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
# include <windows.h>
|
||||
#elif defined(__GLIBC__) || defined(__CYGWIN__)
|
||||
# include <errno.h>
|
||||
#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
|
||||
# include <stdlib.h>
|
||||
#elif defined(PIPE_OS_HAIKU)
|
||||
# include <kernel/OS.h>
|
||||
# include <kernel/image.h>
|
||||
#else
|
||||
#warning unexpected platform in os_process.c
|
||||
#endif
|
||||
|
||||
#if defined(PIPE_OS_LINUX)
|
||||
|
|
@ -84,20 +79,13 @@ os_get_process_name(char *procname, size_t size)
|
|||
|
||||
name = lpProcessName;
|
||||
|
||||
#elif defined(__GLIBC__) || defined(__CYGWIN__)
|
||||
name = program_invocation_short_name;
|
||||
#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_ANDROID)
|
||||
/* *BSD and OS X */
|
||||
name = getprogname();
|
||||
#elif defined(PIPE_OS_HAIKU)
|
||||
image_info info;
|
||||
get_image_info(B_CURRENT_TEAM, &info);
|
||||
name = info.name;
|
||||
#else
|
||||
#warning unexpected platform in os_process.c
|
||||
return FALSE;
|
||||
name = util_get_process_name();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
assert(size > 0);
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ __getProgramName()
|
|||
# define GET_PROGRAM_NAME() getprogname()
|
||||
#elif defined(__APPLE__)
|
||||
# define GET_PROGRAM_NAME() getprogname()
|
||||
#elif defined(ANDROID)
|
||||
# define GET_PROGRAM_NAME() getprogname()
|
||||
#elif defined(__sun)
|
||||
/* Solaris has getexecname() which returns the full path - return just
|
||||
the basename to match BSD getprogname() */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue