Accepted patch from Mark Hindley which avoids clearing realpath information

in pidof when trying to find matching executables.
This commit is contained in:
Jesse
2023-03-29 10:34:45 -03:00
parent e7f4361bde
commit c06458e1c1
3 changed files with 4 additions and 2 deletions

View File

@@ -740,8 +740,8 @@ PIDQ_HEAD *pidof(char *prog)
return NULL;
/* Try to stat the executable. */
memset(real_path, 0, sizeof(real_path));
if ( (prog[0] == '/') && ( realpath(prog, real_path) ) ) {
memset(&real_path[0], 0, sizeof(real_path));
dostat++;
}