diff options
Diffstat (limited to 'src/librc/librc-daemon.c')
-rw-r--r-- | src/librc/librc-daemon.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index e2e3bbf1..98744e1e 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -83,34 +83,12 @@ static bool pid_is_exec(pid_t pid, const char *const *argv) { char cmdline[32]; char buffer[PATH_MAX]; - char *p; int fd; ssize_t bytes; - /* Check it's the right binary */ - snprintf(cmdline, sizeof(cmdline), "/proc/%u/exe", pid); - bytes = readlink(cmdline, buffer, sizeof(buffer)); - if (bytes > 0) { - buffer[bytes] = '\0'; - if (strcmp(*argv, buffer) == 0) - return true; - - /* We should cater for deleted binaries too */ - bytes = strlen(buffer); - if (bytes) { - p = buffer + (bytes - 10); - if (strcmp(p, " (deleted)") == 0) { - *p = '\0'; - if (strcmp(buffer, *argv) == 0) - return true; - } - } - } - snprintf(cmdline, sizeof(cmdline), "/proc/%u/cmdline", pid); if ((fd = open(cmdline, O_RDONLY)) < 0) return false; - bytes = read(fd, buffer, sizeof(buffer)); close(fd); if (bytes == -1) |