Deleted Added
sdiff udiff text old ( 21673 ) new ( 21915 )
full compact
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 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
485#ifdef VERBOSE
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
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
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
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 ---