aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2010-11-30 13:33:21 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2010-11-30 13:33:21 -0500
commit83006e3788088485164ea1464a02012c102995b5 (patch)
treeef1b2d796593615f25cba7f47a7c6df7856ced92
parentc9333cdb1321d571dfc8f825c6cb20c4c10048a6 (diff)
downloadNetNuke2-83006e3788088485164ea1464a02012c102995b5.tar.gz
Fixed 3.2GB transfer limit.
-rw-r--r--netnuke.h2
-rw-r--r--nukectl.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/netnuke.h b/netnuke.h
index 9e606cb..96aac63 100644
--- a/netnuke.h
+++ b/netnuke.h
@@ -35,6 +35,8 @@
#define NNLOGFILE "netnuke.log"
#define self __FUNCTION__
+#define _FILE_OFFSET_BITS 64
+
typedef struct nndevice_t
{
char path[50];
diff --git a/nukectl.c b/nukectl.c
index 723d411..8b0897b 100644
--- a/nukectl.c
+++ b/nukectl.c
@@ -36,7 +36,7 @@ void* wipe(void* device)
{
nndevice_t* d = (nndevice_t*)device;
int output_progress = 0;
- unsigned int blocks = d->blksz * d->blks;
+ unsigned long int blocks = d->blksz * d->blks;
unsigned long long blocks_written = 0;
long double percent = 0.0L;
@@ -46,7 +46,7 @@ void* wipe(void* device)
COM(self, "Unable to open %s: %s\n", d->path, strerror(errno));
return (int*)1;
}
- COM(self, "path: %s, block size %d, blocks %lu, total bytes %lu\n",
+ COM(self, "path: %s, block size %d, blocks %llu, total bytes %llu\n",
d->path, d->blksz, d->blks, d->sz);
srand(nngetseed());
@@ -58,11 +58,10 @@ void* wipe(void* device)
if(output_progress >= 102400)
{
- percent = (blocks_written / (long double)d->sz) * 100;
+ percent = (long double)((blocks_written / (long double)d->sz) * 100);
printf("%s: %llu of %llu (%0.2Lf%%)\n", d->path, blocks_written, d->sz, percent);
output_progress = 0;
}
-
++output_progress;
}
COM(self, "%s complete\n", d->path);
@@ -85,7 +84,7 @@ pthread_t nnthread(nndevice_t* device)
int nnwrite(FILE* fp, int bsize)
{
- int bytes_written = 0;
+ unsigned int bytes_written = 0;
char* buffer = randstr(bsize);
pthread_mutex_lock(&lock_write);
//bytes_written = fwrite(buffer, sizeof(char), bsize, fp);