Deleted Added
full compact
tzsetup.c (21673) tzsetup.c (21915)
1/*
2 * Copyright 1996 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

--- 12 unchanged lines hidden (view full) ---

21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Copyright 1996 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

--- 12 unchanged lines hidden (view full) ---

21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/usr.sbin/tzsetup/tzsetup.c 21673 1997-01-14 07:20:47Z jkh $
29 * $FreeBSD: head/usr.sbin/tzsetup/tzsetup.c 21915 1997-01-21 10:53:38Z jkh $
30 */
31
32/*
33 * Second attempt at a `tzmenu' program, using the separate description
34 * files provided in newer tzdata releases.
35 */
36
37#include <sys/types.h>

--- 439 unchanged lines hidden (view full) ---

477 if (lstat(_PATH_LOCALTIME, &sb) < 0)
478 /* Nothing there yet... */
479 copymode = 1;
480 else if(S_ISLNK(sb.st_mode))
481 copymode = 0;
482 else
483 copymode = 1;
484
30 */
31
32/*
33 * Second attempt at a `tzmenu' program, using the separate description
34 * files provided in newer tzdata releases.
35 */
36
37#include <sys/types.h>

--- 439 unchanged lines hidden (view full) ---

477 if (lstat(_PATH_LOCALTIME, &sb) < 0)
478 /* Nothing there yet... */
479 copymode = 1;
480 else if(S_ISLNK(sb.st_mode))
481 copymode = 0;
482 else
483 copymode = 1;
484
485#ifdef VERBOSE
485 if (copymode)
486 asprintf(&msg, "Copying %s to " _PATH_LOCALTIME, filename);
487 else
488 asprintf(&msg, "Creating symbolic link " _PATH_LOCALTIME
489 " to %s", filename);
490
491 dialog_notify(msg);
492 free(msg);
486 if (copymode)
487 asprintf(&msg, "Copying %s to " _PATH_LOCALTIME, filename);
488 else
489 asprintf(&msg, "Creating symbolic link " _PATH_LOCALTIME
490 " to %s", filename);
491
492 dialog_notify(msg);
493 free(msg);
494#endif
493
494 if (reallydoit) {
495 if (copymode) {
496 fd1 = open(filename, O_RDONLY, 0);
497 if (fd1 < 0) {
498 asprintf(&msg, "Could not open %s: %s",
499 filename, strerror(errno));
500 dialog_mesgbox("Error", msg, 8, 72);

--- 44 unchanged lines hidden (view full) ---

545 filename, strerror(errno));
546 dialog_mesgbox("Error", msg, 8, 72);
547 free(msg);
548 return DITEM_FAILURE | DITEM_RECREATE;
549 }
550 }
551 }
552
495
496 if (reallydoit) {
497 if (copymode) {
498 fd1 = open(filename, O_RDONLY, 0);
499 if (fd1 < 0) {
500 asprintf(&msg, "Could not open %s: %s",
501 filename, strerror(errno));
502 dialog_mesgbox("Error", msg, 8, 72);

--- 44 unchanged lines hidden (view full) ---

547 filename, strerror(errno));
548 dialog_mesgbox("Error", msg, 8, 72);
549 free(msg);
550 return DITEM_FAILURE | DITEM_RECREATE;
551 }
552 }
553 }
554
555#ifdef VERBOSE
553 if (copymode)
554 asprintf(&msg, "Copied timezone file from %s to "
555 _PATH_LOCALTIME, filename);
556 else
557 asprintf(&msg, "Created symbolic link from " _PATH_LOCALTIME
558 " to %s", filename);
559
560 dialog_mesgbox("Done", msg, 8, 72);
561 free(msg);
556 if (copymode)
557 asprintf(&msg, "Copied timezone file from %s to "
558 _PATH_LOCALTIME, filename);
559 else
560 asprintf(&msg, "Created symbolic link from " _PATH_LOCALTIME
561 " to %s", filename);
562
563 dialog_mesgbox("Done", msg, 8, 72);
564 free(msg);
565#endif
562 return DITEM_LEAVE_MENU;
563}
564
565static int
566confirm_zone(const char *filename)
567{
568 char *msg;
569 struct tm *tm;

--- 81 unchanged lines hidden ---
566 return DITEM_LEAVE_MENU;
567}
568
569static int
570confirm_zone(const char *filename)
571{
572 char *msg;
573 struct tm *tm;

--- 81 unchanged lines hidden ---