summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorErik Andersen2000-03-23 01:09:18 +0000
committerErik Andersen2000-03-23 01:09:18 +0000
commit298854f02963bd8e43dfeb7224d88cfeb0c932cb (patch)
tree7a2fbb55e55f980edddb0d627c3f3e79c8f793b0 /coreutils
parentec5bd90916b6e815a36c14ac04d1b78e3e487400 (diff)
downloadbusybox-298854f02963bd8e43dfeb7224d88cfeb0c932cb.zip
busybox-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.gz
My latest ramblings.
-Erik
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/date.c4
-rw-r--r--coreutils/dd.c24
-rw-r--r--coreutils/ls.c5
-rw-r--r--coreutils/tee.c6
4 files changed, 23 insertions, 16 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 652db8d..199a894 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -202,8 +202,8 @@ int date_main(int argc, char **argv)
usage(date_usage);
}
} else {
- if ((date_fmt == NULL) && (strcmp(*argv, "+") == 0))
- date_fmt = *argv;
+ if ((date_fmt == NULL) && (**argv == '+'))
+ date_fmt = *argv + 1; /* Skip over the '+' */
else if (date_str == NULL) {
set_time = 1;
date_str = *argv;
diff --git a/coreutils/dd.c b/coreutils/dd.c
index f40dec7..d50cf74 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -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);
diff --git a/coreutils/ls.c b/coreutils/ls.c
index c2266f5..c4856cb 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -70,11 +70,6 @@
#define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)])
#endif
-#ifndef MAJOR
-#define MAJOR(dev) (((dev)>>8)&0xff)
-#define MINOR(dev) ((dev)&0xff)
-#endif
-
#define FMT_AUTO 0
#define FMT_LONG 1 /* one record per line, extended info */
#define FMT_SINGLE 2 /* one record per line */
diff --git a/coreutils/tee.c b/coreutils/tee.c
index a3a1c81..018fe11 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -125,8 +125,10 @@ int tee_main(int argc, char **argv)
/* clean up */
FL_apply(tee_fclose, 0);
- free(FileList);
+ /* Don't bother to close files Exit does that
+ * automagically, so we can save a few bytes */
+ /* free(FileList); */
exit(0);
}
-/* $Id: tee.c,v 1.7 2000/03/08 00:14:35 beppu Exp $ */
+/* $Id: tee.c,v 1.8 2000/03/23 01:09:18 erik Exp $ */