From 80c56d099e37003451b5de18c25112e56f14843a Mon Sep 17 00:00:00 2001 From: Cesare Tirabassi Date: Sat, 30 Jan 2010 19:17:17 +0100 Subject: [PATCH] Modify last commit to keep compiler happy since it claims devbuf can never be null (should we really trust gcc that much?) --- src/linux.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/linux.cc b/src/linux.cc index bf02697a..88be11b2 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -2305,12 +2305,10 @@ void update_diskio(void) && major != RAMDISK_MAJOR && major != LOOP_MAJOR) { /* If the last character of the device is a digit we assume * it is a subdevice (needed for kernel > 2.6.31) */ - if (devbuf) { - len_devbuf = strlen(devbuf); - if ((len_devbuf > 0) && !isdigit(devbuf[len_devbuf-1])) { - total_reads += reads; - total_writes += writes; - } + len_devbuf = strlen(devbuf); + if ((len_devbuf > 0) && !isdigit(devbuf[len_devbuf-1])) { + total_reads += reads; + total_writes += writes; } } else { col_count = sscanf(buf, "%u %u %s %*u %u %*u %u",