aboutsummaryrefslogtreecommitdiff
path: root/coreutils/date.c
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/date.c
parente454fb68a3165ca5cf42c290b4b9dc92dbf9a235 (diff)
downloadbusybox-w32-1ad302ac903695ef4ba748d3880222c05eeaafef.tar.gz
busybox-w32-1ad302ac903695ef4ba748d3880222c05eeaafef.tar.bz2
busybox-w32-1ad302ac903695ef4ba748d3880222c05eeaafef.zip
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/date.c')
-rw-r--r--coreutils/date.c23
1 files changed, 7 insertions, 16 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)
64 &(tm_time->tm_min), &(tm_time->tm_year)); 64 &(tm_time->tm_min), &(tm_time->tm_year));
65 65
66 if (nr < 4 || nr > 5) { 66 if (nr < 4 || nr > 5) {
67 fprintf(stderr, invalid_date, "date", t_string); 67 fatalError(invalid_date, "date", t_string);
68 exit(FALSE);
69 } 68 }
70 69
71 /* correct for century - minor Y2K problem here? */ 70 /* correct for century - minor Y2K problem here? */
@@ -149,10 +148,7 @@ struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
149 148
150 } 149 }
151 150
152 fprintf(stderr, invalid_date, "date", t_string); 151 fatalError(invalid_date, "date", t_string);
153
154 exit(FALSE);
155
156} 152}
157 153
158 154
@@ -187,10 +183,8 @@ int date_main(int argc, char **argv)
187 break; 183 break;
188 case 'u': 184 case 'u':
189 utc = 1; 185 utc = 1;
190 if (putenv("TZ=UTC0") != 0) { 186 if (putenv("TZ=UTC0") != 0)
191 fprintf(stderr, memory_exhausted, "date"); 187 fatalError(memory_exhausted, "date");
192 exit(FALSE);
193 }
194 /* Look ma, no break. Don't fix it either. */ 188 /* Look ma, no break. Don't fix it either. */
195 case 'd': 189 case 'd':
196 use_arg = 1; 190 use_arg = 1;
@@ -239,16 +233,13 @@ int date_main(int argc, char **argv)
239 233
240 /* Correct any day of week and day of year etc fields */ 234 /* Correct any day of week and day of year etc fields */
241 tm = mktime(&tm_time); 235 tm = mktime(&tm_time);
242 if (tm < 0) { 236 if (tm < 0)
243 fprintf(stderr, invalid_date, "date", date_str); 237 fatalError(invalid_date, "date", date_str);
244 exit(FALSE);
245 }
246 238
247 /* if setting time, set it */ 239 /* if setting time, set it */
248 if (set_time) { 240 if (set_time) {
249 if (stime(&tm) < 0) { 241 if (stime(&tm) < 0) {
250 fprintf(stderr, "date: can't set date.\n"); 242 fatalError("date: can't set date.\n");
251 exit(FALSE);
252 } 243 }
253 } 244 }
254 } 245 }