projects
/
tools
/
apitrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
853b289
)
Use the process ID as process name when /proc/self/exe can't be read.
author
José Fonseca
<jfonseca@vmware.com>
Mon, 23 May 2011 20:14:03 +0000
(21:14 +0100)
committer
José Fonseca
<jfonseca@vmware.com>
Mon, 23 May 2011 20:14:03 +0000
(21:14 +0100)
/proc/self/exe is not available on setuid processes.
os_posix.cpp
patch
|
blob
|
history
diff --git
a/os_posix.cpp
b/os_posix.cpp
index
ff320d0
..
fdcaca9
100644
(file)
--- a/
os_posix.cpp
+++ b/
os_posix.cpp
@@
-77,8
+77,8
@@
GetProcessName(char *str, size_t size)
ssize_t len;
len = readlink("/proc/self/exe", szProcessPath, sizeof(szProcessPath) - 1);
if (len == -1) {
-
*str = 0
;
- return
fals
e;
+
snprintf(str, size, "%i", (int)getpid())
;
+ return
tru
e;
}
#endif
szProcessPath[len] = 0;