From b2789c83b78ccc41b1ec7429edd88fcdd9cea69e Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 22 Sep 2009 21:00:50 +0000 Subject: We can now collect stats on different devices. --- netnuke.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/netnuke.c b/netnuke.c index 41152f6..27026c5 100644 --- a/netnuke.c +++ b/netnuke.c @@ -258,7 +258,10 @@ int nuke(media_t device) bytesWritten = write(fd, wTable, byteSize); if(bytesWritten != byteSize) - fprintf(stderr, "%s: %s, while writing chunk %jd\n", device.nameshort, strerror(errno), block); + { + int64_t current = lseek(fd, 0L, SEEK_CUR); + fprintf(stderr, "%s: %s, while writing chunk %jd. seek position %jd\n", device.nameshort, strerror(errno), block, current); + } } /* BLOCK WRITE */ @@ -311,14 +314,14 @@ void buildMediaList(media_t devices[]) { /* This is not the only way to do this. Especially because it is NOT * dynamic to the mediaList at all... */ - if(strstr(device.name, "ad") == 0 || - strstr(device.name, "hd") == 0) + if(strstr(device.name, "ad") != NULL || + strstr(device.name, "hd") != NULL) { device_stats.ide++; } - else if(strstr(device.name, "da") == 0 || - strstr(device.name, "sd") == 0) + else if(strstr(device.name, "da") != NULL || + strstr(device.name, "sd") != NULL) { device_stats.scsi++; } -- cgit