diff options
author | Erik Andersen | 2000-03-23 01:09:18 +0000 |
---|---|---|
committer | Erik Andersen | 2000-03-23 01:09:18 +0000 |
commit | 298854f02963bd8e43dfeb7224d88cfeb0c932cb (patch) | |
tree | 7a2fbb55e55f980edddb0d627c3f3e79c8f793b0 /dd.c | |
parent | ec5bd90916b6e815a36c14ac04d1b78e3e487400 (diff) | |
download | busybox-298854f02963bd8e43dfeb7224d88cfeb0c932cb.zip busybox-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.gz |
My latest ramblings.
-Erik
Diffstat (limited to 'dd.c')
-rw-r--r-- | dd.c | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -125,9 +125,12 @@ extern int dd_main(int argc, char **argv) inFd = open(inFile, 0); if (inFd < 0) { - perror(inFile); - free(buf); - exit(FALSE); + /* Note that we are not freeing buf or closing + * files here to save a few bytes. This exits + * here anyways... */ + + /* free(buf); */ + fatalError( inFile); } if (outFile == NULL) @@ -136,10 +139,13 @@ extern int dd_main(int argc, char **argv) outFd = open(outFile, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (outFd < 0) { - perror(outFile); - close(inFd); - free(buf); - exit(FALSE); + /* Note that we are not freeing buf or closing + * files here to save a few bytes. This exits + * here anyways... */ + + /* close(inFd); + free(buf); */ + fatalError( outFile); } lseek(inFd, skipBlocks * blockSize, SEEK_SET); @@ -180,9 +186,13 @@ extern int dd_main(int argc, char **argv) perror(inFile); cleanup: + /* Note that we are not freeing memory or closing + * files here, to save a few bytes. */ +#if 0 close(inFd); close(outFd); free(buf); +#endif printf("%ld+%d records in\n", (long) (intotal / blockSize), (intotal % blockSize) != 0); |