diff options
author | Martin Baulig <martin@src.gnome.org> | 2000-02-14 14:25:34 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 2000-02-14 14:25:34 +0000 |
commit | 00a32c887cfc3f0ad85e6a3ec4ca91ac5c9431a0 (patch) | |
tree | 607d4afbb5720306067be0f2579a125025f2b951 /sysdeps/linux/glibtop_server.h | |
parent | c92bf0f9a9106d8e6ca33f2edbbf5e56ea2b5bb4 (diff) | |
download | libgtop-00a32c887cfc3f0ad85e6a3ec4ca91ac5c9431a0.tar.gz |
Make sure we close all open files.
Diffstat (limited to 'sysdeps/linux/glibtop_server.h')
-rw-r--r-- | sysdeps/linux/glibtop_server.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 4889d2df..a8d3e083 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -71,10 +71,11 @@ proc_file_to_buffer (char *buffer, const char *fmt, pid_t pid) if (fd < 0) return -1; len = read (fd, buffer, BUFSIZ-1); - if (len < 0) return -1; - close (fd); + if (len < 0) + return -1; + buffer [len] = '\0'; return 0; |