aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-24 00:54:46 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-24 00:54:46 +0000
commit1ad302ac903695ef4ba748d3880222c05eeaafef (patch)
treea03bebb080253f4a20f8d5335285a5e717106d36 /coreutils
parente454fb68a3165ca5cf42c290b4b9dc92dbf9a235 (diff)
downloadbusybox-1ad302ac903695ef4ba748d3880222c05eeaafef.tar.gz
The new tar for busybox is now done, and works just fine
for extracting files. Creation of tarballs is next... -Erik
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/date.c23
-rw-r--r--coreutils/dd.c4
-rw-r--r--coreutils/ls.c5
3 files changed, 14 insertions, 18 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 199a894c0..25ce05d2d 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -64,8 +64,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
&(tm_time->tm_min), &(tm_time->tm_year));
if (nr < 4 || nr > 5) {
- fprintf(stderr, invalid_date, "date", t_string);
- exit(FALSE);
+ fatalError(invalid_date, "date", t_string);
}
/* correct for century - minor Y2K problem here? */
@@ -149,10 +148,7 @@ struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
}
- fprintf(stderr, invalid_date, "date", t_string);
-
- exit(FALSE);
-
+ fatalError(invalid_date, "date", t_string);
}
@@ -187,10 +183,8 @@ int date_main(int argc, char **argv)
break;
case 'u':
utc = 1;
- if (putenv("TZ=UTC0") != 0) {
- fprintf(stderr, memory_exhausted, "date");
- exit(FALSE);
- }
+ if (putenv("TZ=UTC0") != 0)
+ fatalError(memory_exhausted, "date");
/* Look ma, no break. Don't fix it either. */
case 'd':
use_arg = 1;
@@ -239,16 +233,13 @@ int date_main(int argc, char **argv)
/* Correct any day of week and day of year etc fields */
tm = mktime(&tm_time);
- if (tm < 0) {
- fprintf(stderr, invalid_date, "date", date_str);
- exit(FALSE);
- }
+ if (tm < 0)
+ fatalError(invalid_date, "date", date_str);
/* if setting time, set it */
if (set_time) {
if (stime(&tm) < 0) {
- fprintf(stderr, "date: can't set date.\n");
- exit(FALSE);
+ fatalError("date: can't set date.\n");
}
}
}
diff --git a/coreutils/dd.c b/coreutils/dd.c
index d50cf746b..9c7d872b1 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -57,8 +57,8 @@ static const char dd_usage[] =
extern int dd_main(int argc, char **argv)
{
- const char *inFile = NULL;
- const char *outFile = NULL;
+ char *inFile = NULL;
+ char *outFile = NULL;
char *cp;
int inFd;
int outFd;
diff --git a/coreutils/ls.c b/coreutils/ls.c
index c4856cb71..3e010503c 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -90,6 +90,11 @@
#define DISP_DIRNAME 128 /* show directory name (for internal use) */
#define DIR_RECURSE 256 /* -R (not yet implemented) */
+#ifndef MAJOR
+#define MAJOR(dev) (((dev)>>8)&0xff)
+#define MINOR(dev) ((dev)&0xff)
+#endif
+
static unsigned char display_fmt = FMT_AUTO;
static unsigned short opts = 0;
static unsigned short column = 0;