Print this page
10120 smatch indenting fixes for usr/src/cmd
Reviewed by: Gergő Doma <domag02@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/zdump/zdump.c
+++ new/usr/src/cmd/zdump/zdump.c
1 1 /*
2 2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3 3 * Use is subject to license terms.
4 4 */
5 5
6 6 /*
7 + * Copyright (c) 2018, Joyent, Inc.
8 + */
9 +
10 +/*
7 11 * zdump 7.24
8 12 * Taken from elsie.nci.nih.gov to replace the existing Solaris zdump,
9 13 * which was based on an earlier version of the elsie code.
10 14 *
11 15 * For zdump 7.24, the following changes were made to the elsie code:
12 16 * locale/textdomain/messages to match existing Solaris style.
13 17 * Solaris verbose mode is documented to display the current time first.
14 18 * cstyle cleaned code.
15 19 * removed old locale/textdomain code.
16 20 */
17 21
18 22 static char elsieid[] = "@(#)zdump.c 7.74";
19 23
20 24 /*
21 25 * This code has been made independent of the rest of the time
22 26 * conversion package to increase confidence in the verification it provides.
23 27 * You can use this code to help in verifying other implementations.
24 28 */
25 29
26 30 #include "stdio.h" /* for stdout, stderr, perror */
27 31 #include "string.h" /* for strcpy */
28 32 #include "sys/types.h" /* for time_t */
29 33 #include "time.h" /* for struct tm */
30 34 #include "stdlib.h" /* for exit, malloc, atoi */
31 35 #include "locale.h" /* for setlocale, textdomain */
32 36 #include "libintl.h"
33 37 #include <ctype.h>
34 38 #include "tzfile.h" /* for defines */
35 39 #include <limits.h>
36 40
37 41 #ifndef ZDUMP_LO_YEAR
38 42 #define ZDUMP_LO_YEAR (-500)
39 43 #endif /* !defined ZDUMP_LO_YEAR */
40 44
41 45 #ifndef ZDUMP_HI_YEAR
42 46 #define ZDUMP_HI_YEAR 2500
43 47 #endif /* !defined ZDUMP_HI_YEAR */
44 48
45 49 #ifndef MAX_STRING_LENGTH
46 50 #define MAX_STRING_LENGTH 1024
47 51 #endif /* !defined MAX_STRING_LENGTH */
48 52
49 53 #ifndef TRUE
50 54 #define TRUE 1
51 55 #endif /* !defined TRUE */
52 56
53 57 #ifndef FALSE
54 58 #define FALSE 0
55 59 #endif /* !defined FALSE */
56 60
57 61 #ifndef isleap_sum
58 62 /*
59 63 * See tzfile.h for details on isleap_sum.
60 64 */
61 65 #define isleap_sum(a, b) isleap((a) % 400 + (b) % 400)
62 66 #endif /* !defined isleap_sum */
63 67
64 68 #ifndef SECSPERDAY
65 69 #define SECSPERDAY ((long)SECSPERHOUR * HOURSPERDAY)
66 70 #endif
67 71 #define SECSPERNYEAR (SECSPERDAY * DAYSPERNYEAR)
68 72 #define SECSPERLYEAR (SECSPERNYEAR + SECSPERDAY)
69 73
70 74 #ifndef GNUC_or_lint
71 75 #ifdef lint
72 76 #define GNUC_or_lint
73 77 #else /* !defined lint */
74 78 #ifdef __GNUC__
75 79 #define GNUC_or_lint
76 80 #endif /* defined __GNUC__ */
77 81 #endif /* !defined lint */
78 82 #endif /* !defined GNUC_or_lint */
79 83
80 84 #ifndef INITIALIZE
81 85 #ifdef GNUC_or_lint
82 86 #define INITIALIZE(x) ((x) = 0)
83 87 #else /* !defined GNUC_or_lint */
84 88 #define INITIALIZE(x)
85 89 #endif /* !defined GNUC_or_lint */
86 90 #endif /* !defined INITIALIZE */
87 91
88 92 static time_t absolute_min_time;
89 93 static time_t absolute_max_time;
90 94 static size_t longest;
91 95 static char *progname;
92 96 static int warned;
93 97
94 98 static char *abbr(struct tm *);
95 99 static void abbrok(const char *, const char *);
96 100 static long delta(struct tm *, struct tm *);
97 101 static void dumptime(const struct tm *);
98 102 static time_t hunt(char *, time_t, time_t);
99 103 static void setabsolutes(void);
100 104 static void show(char *, time_t, int);
101 105 static void usage(void);
102 106 static const char *tformat(void);
103 107 static time_t yeartot(long y);
104 108
105 109 #ifndef TYPECHECK
106 110 #define my_localtime localtime
107 111 #else /* !defined TYPECHECK */
108 112 static struct tm *
109 113 my_localtime(tp)
110 114 time_t *tp;
111 115 {
112 116 register struct tm *tmp;
113 117
114 118 tmp = localtime(tp);
115 119 if (tp != NULL && tmp != NULL) {
116 120 struct tm tm;
117 121 register time_t t;
118 122
119 123 tm = *tmp;
120 124 t = mktime(&tm);
121 125 if (t - *tp >= 1 || *tp - t >= 1) {
122 126 (void) fflush(stdout);
123 127 (void) fprintf(stderr, "\n%s: ", progname);
124 128 (void) fprintf(stderr, tformat(), *tp);
125 129 (void) fprintf(stderr, " ->");
126 130 (void) fprintf(stderr, " year=%d", tmp->tm_year);
127 131 (void) fprintf(stderr, " mon=%d", tmp->tm_mon);
128 132 (void) fprintf(stderr, " mday=%d", tmp->tm_mday);
129 133 (void) fprintf(stderr, " hour=%d", tmp->tm_hour);
130 134 (void) fprintf(stderr, " min=%d", tmp->tm_min);
131 135 (void) fprintf(stderr, " sec=%d", tmp->tm_sec);
132 136 (void) fprintf(stderr, " isdst=%d", tmp->tm_isdst);
133 137 (void) fprintf(stderr, " -> ");
134 138 (void) fprintf(stderr, tformat(), t);
135 139 (void) fprintf(stderr, "\n");
136 140 }
137 141 }
138 142 return (tmp);
139 143 }
140 144 #endif /* !defined TYPECHECK */
141 145
142 146 static void
143 147 abbrok(const char * const abbrp, const char * const zone)
144 148 {
145 149 register const char *cp;
146 150 int error = 0;
147 151
148 152 if (warned)
149 153 return;
150 154 cp = abbrp;
151 155 while (isalpha(*cp) || isdigit(*cp) || *cp == '-' || *cp == '+')
152 156 ++cp;
153 157 (void) fflush(stdout);
154 158 if (cp - abbrp < 3) {
155 159 (void) fprintf(stderr, gettext("%s: warning: zone \"%s\" "
156 160 "abbreviation \"%s\" has fewer than 3 alphabetics\n"),
157 161 progname, zone, abbrp);
158 162 error = 1;
159 163 } else if (cp - abbrp > 6) {
160 164 (void) fprintf(stderr, gettext("%s: warning: zone \"%s\" "
161 165 "abbreviation \"%s\" has more than 6 characters\n"),
162 166 progname, zone, abbrp);
163 167 error = 1;
164 168 } else if (*cp != '\0') {
165 169 (void) fprintf(stderr, gettext("%s: warning: zone \"%s\" "
166 170 "abbreviation \"%s\" has characters other than "
167 171 "alphanumerics\n"), progname, zone, abbrp);
168 172 error = 1;
169 173 }
170 174 if (error)
171 175 warned = TRUE;
172 176 }
173 177
174 178 int
175 179 main(argc, argv)
176 180 int argc;
177 181 char *argv[];
178 182 {
179 183 register int i;
180 184 register int c;
181 185 register int vflag;
182 186 register char *cutarg;
183 187 register long cutloyear = ZDUMP_LO_YEAR;
184 188 register long cuthiyear = ZDUMP_HI_YEAR;
185 189 register time_t cutlotime;
186 190 register time_t cuthitime;
187 191 time_t now;
188 192 time_t t;
189 193 time_t newt;
190 194 struct tm tm;
191 195 struct tm newtm;
192 196 register struct tm *tmp;
193 197 register struct tm *newtmp;
194 198
195 199 INITIALIZE(cutlotime);
196 200 INITIALIZE(cuthitime);
197 201
198 202 (void) setlocale(LC_ALL, "");
199 203 #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
200 204 #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
201 205 #endif
202 206 (void) textdomain(TEXT_DOMAIN);
203 207
204 208 progname = argv[0];
205 209 for (i = 1; i < argc; ++i)
206 210 if (strcmp(argv[i], "--version") == 0) {
207 211 (void) printf("%s\n", elsieid);
208 212 exit(EXIT_SUCCESS);
209 213 }
210 214 vflag = 0;
211 215 cutarg = NULL;
212 216 while ((c = getopt(argc, argv, "c:v")) == 'c' || c == 'v')
213 217 if (c == 'v')
214 218 vflag = 1;
215 219 else cutarg = optarg;
216 220 if (c != EOF ||
217 221 (optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
218 222 usage();
219 223 /* NOTREACHED */
220 224 }
221 225 if (vflag) {
222 226 if (cutarg != NULL) {
223 227 long lo;
↓ open down ↓ |
207 lines elided |
↑ open up ↑ |
224 228 long hi;
225 229 char dummy;
226 230
227 231 if (sscanf(cutarg, "%ld%c", &hi, &dummy) == 1) {
228 232 cuthiyear = hi;
229 233 } else if (sscanf(cutarg, "%ld,%ld%c",
230 234 &lo, &hi, &dummy) == 2) {
231 235 cutloyear = lo;
232 236 cuthiyear = hi;
233 237 } else {
234 -(void) fprintf(stderr, gettext("%s: wild -c argument %s\n"),
235 - progname, cutarg);
238 + (void) fprintf(stderr,
239 + gettext("%s: wild -c argument %s\n"),
240 + progname, cutarg);
236 241 exit(EXIT_FAILURE);
237 242 }
238 243 }
239 244 setabsolutes();
240 245 cutlotime = yeartot(cutloyear);
241 246 cuthitime = yeartot(cuthiyear);
242 247 }
243 248 (void) time(&now);
244 249 longest = 0;
245 250 for (i = optind; i < argc; ++i)
246 251 if (strlen(argv[i]) > longest)
247 252 longest = strlen(argv[i]);
248 253
249 254 for (i = optind; i < argc; ++i) {
250 255 static char buf[MAX_STRING_LENGTH];
251 256 static char *tzp = NULL;
252 257
253 258 (void) unsetenv("TZ");
254 259 if (tzp != NULL)
255 260 free(tzp);
256 261 if ((tzp = malloc(3 + strlen(argv[i]) + 1)) == NULL) {
257 262 perror(progname);
258 263 exit(EXIT_FAILURE);
259 264 }
260 265 (void) strcpy(tzp, "TZ=");
261 266 (void) strcat(tzp, argv[i]);
262 267 if (putenv(tzp) != 0) {
263 268 perror(progname);
264 269 exit(EXIT_FAILURE);
265 270 }
266 271 if (!vflag) {
267 272 show(argv[i], now, FALSE);
268 273 continue;
269 274 }
270 275
271 276 #if defined(sun)
272 277 /*
273 278 * We show the current time first, probably because we froze
274 279 * the behavior of zdump some time ago and then it got
275 280 * changed.
276 281 */
277 282 show(argv[i], now, TRUE);
278 283 #endif
279 284 warned = FALSE;
280 285 t = absolute_min_time;
281 286 show(argv[i], t, TRUE);
282 287 t += SECSPERHOUR * HOURSPERDAY;
283 288 show(argv[i], t, TRUE);
284 289 if (t < cutlotime)
285 290 t = cutlotime;
286 291 tmp = my_localtime(&t);
287 292 if (tmp != NULL) {
288 293 tm = *tmp;
289 294 (void) strncpy(buf, abbr(&tm), sizeof (buf) - 1);
290 295 }
291 296 for (;;) {
292 297 if (t >= cuthitime)
293 298 break;
294 299 /* check if newt will overrun maximum time_t value */
295 300 if (t > LONG_MAX - (SECSPERHOUR * 12))
296 301 break;
297 302 newt = t + SECSPERHOUR * 12;
298 303 if (newt >= cuthitime)
299 304 break;
300 305 newtmp = localtime(&newt);
301 306 if (newtmp != NULL)
302 307 newtm = *newtmp;
303 308 if ((tmp == NULL || newtmp == NULL) ? (tmp != newtmp) :
304 309 (delta(&newtm, &tm) != (newt - t) ||
305 310 newtm.tm_isdst != tm.tm_isdst ||
306 311 strcmp(abbr(&newtm), buf) != 0)) {
307 312 newt = hunt(argv[i], t, newt);
308 313 newtmp = localtime(&newt);
309 314 if (newtmp != NULL) {
310 315 newtm = *newtmp;
311 316 (void) strncpy(buf,
312 317 abbr(&newtm),
313 318 sizeof (buf) - 1);
314 319 }
315 320 }
316 321 t = newt;
317 322 tm = newtm;
318 323 tmp = newtmp;
319 324 }
320 325 t = absolute_max_time;
321 326 #if defined(sun)
322 327 show(argv[i], t, TRUE);
323 328 t -= SECSPERHOUR * HOURSPERDAY;
324 329 show(argv[i], t, TRUE);
325 330 #else /* !defined(sun) */
326 331 t -= SECSPERHOUR * HOURSPERDAY;
327 332 show(argv[i], t, TRUE);
328 333 t += SECSPERHOUR * HOURSPERDAY;
329 334 show(argv[i], t, TRUE);
330 335 #endif /* !defined(sun) */
331 336 }
332 337 if (fflush(stdout) || ferror(stdout)) {
333 338 (void) fprintf(stderr, "%s: ", progname);
334 339 (void) perror(gettext("Error writing standard output"));
335 340 exit(EXIT_FAILURE);
336 341 }
337 342 return (EXIT_SUCCESS);
338 343 }
339 344
340 345 static void
341 346 setabsolutes()
342 347 {
343 348 #if defined(sun)
344 349 absolute_min_time = LONG_MIN;
345 350 absolute_max_time = LONG_MAX;
346 351 #else
347 352 if (0.5 == (time_t)0.5) {
348 353 /*
349 354 * time_t is floating.
350 355 */
351 356 if (sizeof (time_t) == sizeof (float)) {
352 357 absolute_min_time = (time_t)-FLT_MAX;
353 358 absolute_max_time = (time_t)FLT_MAX;
354 359 } else if (sizeof (time_t) == sizeof (double)) {
355 360 absolute_min_time = (time_t)-DBL_MAX;
356 361 absolute_max_time = (time_t)DBL_MAX;
357 362 } else {
358 363 (void) fprintf(stderr, gettext("%s: use of -v on "
359 364 "system with floating time_t other than float "
360 365 "or double\n"), progname);
361 366 exit(EXIT_FAILURE);
362 367 }
363 368 } else
364 369 /*CONSTANTCONDITION*/
365 370 if (0 > (time_t)-1) {
366 371 /*
367 372 * time_t is signed.
368 373 */
369 374 register time_t hibit;
370 375
371 376 for (hibit = 1; (hibit * 2) != 0; hibit *= 2)
372 377 continue;
373 378 absolute_min_time = hibit;
374 379 absolute_max_time = -(hibit + 1);
375 380 } else {
376 381 /*
377 382 * time_t is unsigned.
378 383 */
379 384 absolute_min_time = 0;
380 385 absolute_max_time = absolute_min_time - 1;
381 386 }
382 387 #endif
383 388 }
384 389
385 390 static time_t
386 391 yeartot(y)
387 392 const long y;
388 393 {
389 394 register long myy;
390 395 register long seconds;
391 396 register time_t t;
392 397
393 398 myy = EPOCH_YEAR;
394 399 t = 0;
395 400 while (myy != y) {
396 401 if (myy < y) {
397 402 seconds = isleap(myy) ? SECSPERLYEAR : SECSPERNYEAR;
398 403 ++myy;
399 404 if (t > absolute_max_time - seconds) {
400 405 t = absolute_max_time;
401 406 break;
402 407 }
403 408 t += seconds;
404 409 } else {
405 410 --myy;
406 411 seconds = isleap(myy) ? SECSPERLYEAR : SECSPERNYEAR;
407 412 if (t < absolute_min_time + seconds) {
408 413 t = absolute_min_time;
409 414 break;
410 415 }
411 416 t -= seconds;
412 417 }
413 418 }
414 419 return (t);
415 420 }
416 421
417 422 static time_t
418 423 hunt(name, lot, hit)
419 424 char *name;
420 425 time_t lot;
421 426 time_t hit;
422 427 {
423 428 time_t t;
424 429 long diff;
425 430 struct tm lotm;
426 431 register struct tm *lotmp;
427 432 struct tm tm;
428 433 register struct tm *tmp;
429 434 char loab[MAX_STRING_LENGTH];
430 435
431 436 lotmp = my_localtime(&lot);
432 437 if (lotmp != NULL) {
433 438 lotm = *lotmp;
434 439 (void) strncpy(loab, abbr(&lotm), sizeof (loab) - 1);
435 440 }
436 441 for (;;) {
437 442 diff = (long)(hit - lot);
438 443 if (diff < 2)
439 444 break;
440 445 t = lot;
441 446 t += diff / 2;
442 447 if (t <= lot)
443 448 ++t;
444 449 else if (t >= hit)
445 450 --t;
446 451 tmp = my_localtime(&t);
447 452 if (tmp != NULL)
448 453 tm = *tmp;
449 454 if ((lotmp == NULL || tmp == NULL) ? (lotmp == tmp) :
450 455 (delta(&tm, &lotm) == (t - lot) &&
451 456 tm.tm_isdst == lotm.tm_isdst &&
452 457 strcmp(abbr(&tm), loab) == 0)) {
453 458 lot = t;
454 459 lotm = tm;
455 460 lotmp = tmp;
456 461 } else hit = t;
457 462 }
458 463 show(name, lot, TRUE);
459 464 show(name, hit, TRUE);
460 465 return (hit);
461 466 }
462 467
463 468 /*
464 469 * Thanks to Paul Eggert for logic used in delta.
465 470 */
466 471
467 472 static long
468 473 delta(newp, oldp)
469 474 struct tm *newp;
470 475 struct tm *oldp;
471 476 {
472 477 register long result;
473 478 register int tmy;
474 479
475 480 if (newp->tm_year < oldp->tm_year)
476 481 return (-delta(oldp, newp));
477 482 result = 0;
478 483 for (tmy = oldp->tm_year; tmy < newp->tm_year; ++tmy)
479 484 result += DAYSPERNYEAR + isleap_sum(tmy, TM_YEAR_BASE);
480 485 result += newp->tm_yday - oldp->tm_yday;
481 486 result *= HOURSPERDAY;
482 487 result += newp->tm_hour - oldp->tm_hour;
483 488 result *= MINSPERHOUR;
484 489 result += newp->tm_min - oldp->tm_min;
485 490 result *= SECSPERMIN;
486 491 result += newp->tm_sec - oldp->tm_sec;
487 492 return (result);
488 493 }
489 494
490 495 static void
491 496 show(zone, t, v)
492 497 char *zone;
493 498 time_t t;
494 499 int v;
495 500 {
496 501 register struct tm *tmp;
497 502
498 503 (void) printf("%-*s ", (int)longest, zone);
499 504 if (v) {
500 505 tmp = gmtime(&t);
501 506 if (tmp == NULL) {
502 507 (void) printf(tformat(), t);
503 508 } else {
504 509 dumptime(tmp);
505 510 (void) printf(" UTC");
506 511 }
507 512 (void) printf(" = ");
508 513 }
509 514 tmp = my_localtime(&t);
510 515 dumptime(tmp);
511 516 if (tmp != NULL) {
512 517 if (*abbr(tmp) != '\0')
513 518 (void) printf(" %s", abbr(tmp));
514 519 if (v) {
515 520 (void) printf(" isdst=%d", tmp->tm_isdst);
516 521 #ifdef TM_GMTOFF
517 522 (void) printf(" gmtoff=%ld", tmp->TM_GMTOFF);
518 523 #endif /* defined TM_GMTOFF */
519 524 }
520 525 }
521 526 (void) printf("\n");
522 527 if (tmp != NULL && *abbr(tmp) != '\0')
523 528 abbrok(abbr(tmp), zone);
524 529 }
525 530
526 531 static char *
527 532 abbr(tmp)
528 533 struct tm *tmp;
529 534 {
530 535 register char *result;
531 536 static char nada;
532 537
533 538 if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1)
534 539 return (&nada);
535 540 result = tzname[tmp->tm_isdst];
536 541 return ((result == NULL) ? &nada : result);
537 542 }
538 543
539 544 /*
540 545 * The code below can fail on certain theoretical systems;
541 546 * it works on all known real-world systems as of 2004-12-30.
542 547 */
543 548
544 549 static const char *
545 550 tformat()
546 551 {
547 552 #if defined(sun)
548 553 /* time_t is signed long */
549 554 return ("%ld");
550 555 #else
551 556 /*CONSTANTCONDITION*/
552 557 if (0.5 == (time_t)0.5) { /* floating */
553 558 /*CONSTANTCONDITION*/
554 559 if (sizeof (time_t) > sizeof (double))
555 560 return ("%Lg");
556 561 return ("%g");
557 562 }
558 563 /*CONSTANTCONDITION*/
559 564 if (0 > (time_t)-1) { /* signed */
560 565 /*CONSTANTCONDITION*/
561 566 if (sizeof (time_t) > sizeof (long))
562 567 return ("%lld");
563 568 /*CONSTANTCONDITION*/
564 569 if (sizeof (time_t) > sizeof (int))
565 570 return ("%ld");
566 571 return ("%d");
567 572 }
568 573 /*CONSTANTCONDITION*/
569 574 if (sizeof (time_t) > sizeof (unsigned long))
570 575 return ("%llu");
571 576 /*CONSTANTCONDITION*/
572 577 if (sizeof (time_t) > sizeof (unsigned int))
573 578 return ("%lu");
574 579 return ("%u");
575 580 #endif
576 581 }
577 582
578 583 static void
579 584 dumptime(timeptr)
580 585 register const struct tm *timeptr;
581 586 {
582 587 static const char wday_name[][3] = {
583 588 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
584 589 };
585 590 static const char mon_name[][3] = {
586 591 "Jan", "Feb", "Mar", "Apr", "May", "Jun",
587 592 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
588 593 };
589 594 register const char *wn;
590 595 register const char *mn;
591 596 register int lead;
592 597 register int trail;
593 598
594 599 if (timeptr == NULL) {
595 600 (void) printf("NULL");
596 601 return;
597 602 }
598 603 /*
599 604 * The packaged versions of localtime and gmtime never put out-of-range
600 605 * values in tm_wday or tm_mon, but since this code might be compiled
601 606 * with other (perhaps experimental) versions, paranoia is in order.
602 607 */
603 608 if (timeptr->tm_wday < 0 || timeptr->tm_wday >=
604 609 (int)(sizeof (wday_name) / sizeof (wday_name[0])))
605 610 wn = "???";
606 611 else wn = wday_name[timeptr->tm_wday];
607 612 if (timeptr->tm_mon < 0 || timeptr->tm_mon >=
608 613 (int)(sizeof (mon_name) / sizeof (mon_name[0])))
609 614 mn = "???";
610 615 else mn = mon_name[timeptr->tm_mon];
611 616 (void) printf("%.3s %.3s%3d %.2d:%.2d:%.2d ",
612 617 wn, mn,
613 618 timeptr->tm_mday, timeptr->tm_hour,
614 619 timeptr->tm_min, timeptr->tm_sec);
615 620 #define DIVISOR 10
616 621 trail = timeptr->tm_year % DIVISOR + TM_YEAR_BASE % DIVISOR;
617 622 lead = timeptr->tm_year / DIVISOR + TM_YEAR_BASE / DIVISOR +
618 623 trail / DIVISOR;
619 624 trail %= DIVISOR;
620 625 if (trail < 0 && lead > 0) {
621 626 trail += DIVISOR;
622 627 --lead;
623 628 } else if (lead < 0 && trail > 0) {
624 629 trail -= DIVISOR;
625 630 ++lead;
626 631 }
627 632 if (lead == 0)
628 633 (void) printf("%d", trail);
629 634 else
630 635 (void) printf("%d%d", lead, ((trail < 0) ? -trail : trail));
631 636 }
632 637
633 638 static void
634 639 usage()
635 640 {
636 641 (void) fprintf(stderr, gettext(
637 642 "%s: [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
638 643 progname);
639 644 exit(EXIT_FAILURE);
640 645 /* NOTREACHED */
641 646 }
↓ open down ↓ |
396 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX