diff options
Diffstat (limited to 'xorg-server/os/client.c')
-rw-r--r-- | xorg-server/os/client.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/xorg-server/os/client.c b/xorg-server/os/client.c index 1311855d5..b5349778b 100644 --- a/xorg-server/os/client.c +++ b/xorg-server/os/client.c @@ -140,10 +140,9 @@ void DetermineClientCmd(pid_t pid, const char **cmdname, const char **cmdargs) /* Read the contents of /proc/pid/cmdline. It should contain the * process name and arguments. */ totsize = read(fd, path, sizeof(path)); + close(fd); if (totsize <= 0) return; - if (close(fd) < 0) - return; path[totsize - 1] = '\0'; /* Contruct the process name without arguments. */ |