From bc2fd372272e4917909358473c07e19c1ce450cc Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 30 Jun 2008 07:33:52 +0000 Subject: nmeter: tiny shrink --- procps/nmeter.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'procps/nmeter.c') diff --git a/procps/nmeter.c b/procps/nmeter.c index 96d0bb951..205cb8251 100644 --- a/procps/nmeter.c +++ b/procps/nmeter.c @@ -132,11 +132,10 @@ static void readfile_z(char *buf, int sz, const char* fname) int fd = xopen(fname, O_RDONLY); buf[0] = '\0'; - if (fd >= 0) { - sz = read(fd, buf, sz-1); - if (sz > 0) buf[sz] = '\0'; - close(fd); - } + sz = read(fd, buf, sz - 1); + if (sz > 0) + buf[sz] = '\0'; + close(fd); } static const char* get_file(proc_file *pf) -- cgit v1.2.3