mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-04 04:17:25 +00:00
Fix w32 build
This commit is contained in:
parent
e4d6be85ff
commit
e0f6f41e68
@ -544,17 +544,16 @@ R_API char *r_sys_pid_to_path(int pid) {
|
||||
// TODO: implement r_sys_pid_to_path on W32
|
||||
return NULL;
|
||||
#elif __APPLE__
|
||||
int ret;
|
||||
char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
|
||||
|
||||
ret = proc_pidpath (pid, pathbuf, sizeof(pathbuf));
|
||||
int ret = proc_pidpath (pid, pathbuf, sizeof(pathbuf));
|
||||
if (ret <= 0)
|
||||
return NULL;
|
||||
return strdup (pathbuf);
|
||||
#else
|
||||
char buf[128], pathbuf[1024];
|
||||
snprintf (buf, "/proc/%d/exe", pid);
|
||||
if (readlink (buf, pathbuf, sizeof (pathbuf))<1)
|
||||
return NULL;
|
||||
#endif
|
||||
return strdup (pathbuf);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user