aboutsummaryrefslogtreecommitdiff
path: root/netnuke.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2009-09-22 17:00:50 -0400
committerJoseph Hunkeler <jhunk@stsci.edu>2009-09-22 17:00:50 -0400
commitb2789c83b78ccc41b1ec7429edd88fcdd9cea69e (patch)
tree4aaf782601d0e2de6e57b7ce88b44f43733c0d80 /netnuke.c
parent1e1db02be05149e637381b4006e466f6ed265a37 (diff)
downloadNetNuke-b2789c83b78ccc41b1ec7429edd88fcdd9cea69e.tar.gz
We can now collect stats on different devices.
Diffstat (limited to 'netnuke.c')
-rw-r--r--netnuke.c13
1 files 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++;
}