FreeBSD Bugzilla – Attachment 114370 Details for
Bug 156019
Add a menu entry to tzsetup to select UTC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
file.shar
file.shar (text/plain), 3.29 KB, created by
Daniel O'Connor
on 2011-03-29 07:50:08 UTC
(
hide
)
Description:
file.shar
Filename:
MIME Type:
Creator:
Daniel O'Connor
Created:
2011-03-29 07:50:08 UTC
Size:
3.29 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># tzsetup-utc-menu.diff ># >echo x - tzsetup-utc-menu.diff >sed 's/^X//' >tzsetup-utc-menu.diff << '25aa59230e4eb211a79aefc8fd34a91c' >X--- tzsetup.c.orig 2011-03-23 08:46:40.000000000 +0000 >X+++ tzsetup.c 2011-03-29 06:43:48.000000000 +0000 >X@@ -66,10 +66,13 @@ >X static char *chrootenv = NULL; >X >X static void usage(void); >X+static int confirm_zone(const char *filename); >X static int continent_country_menu(dialogMenuItem *); >X+static int install_zoneinfo_file(const char *zoneinfo_file); >X static int set_zone_multi(dialogMenuItem *); >X static int set_zone_whole_country(dialogMenuItem *); >X static int set_zone_menu(dialogMenuItem *); >X+static int set_zone_utc(void); >X >X struct continent { >X dialogMenuItem *menu; >X@@ -79,7 +82,7 @@ >X }; >X >X static struct continent africa, america, antarctica, arctic, asia, atlantic; >X-static struct continent australia, europe, indian, pacific; >X+static struct continent australia, europe, indian, pacific, utc; >X >X static struct continent_names { >X const char *name; >X@@ -94,7 +97,8 @@ >X { "Australia", &australia }, >X { "Europe", &europe }, >X { "Indian", &indian }, >X- { "Pacific", &pacific } >X+ { "Pacific", &pacific }, >X+ { "UTC", &utc } >X }; >X >X static struct continent_items { >X@@ -110,7 +114,8 @@ >X { "7", "Australia" }, >X { "8", "Europe" }, >X { "9", "Indian Ocean" }, >X- { "0", "Pacific Ocean" } >X+ { "0", "Pacific Ocean" }, >X+ { "a", "UTC" } >X }; >X >X #define NCONTINENTS \ >X@@ -128,6 +133,9 @@ >X int menulen; >X int rv; >X >X+ if (!strcmp(continent->title, "UTC")) >X+ return set_zone_utc(); >X+ >X /* Short cut -- if there's only one country, don't post a menu. */ >X if (contp->nitems == 1) >X return (contp->menu[0].fire(&contp->menu[0])); >X@@ -502,6 +510,15 @@ >X return (DITEM_LEAVE_MENU); >X } >X >X+int >X+set_zone_utc(void) >X+{ >X+ if (!confirm_zone(NULL)) >X+ return (DITEM_FAILURE | DITEM_RECREATE); >X+ >X+ return (install_zoneinfo_file(NULL)); >X+} >X+ >X static int >X install_zoneinfo_file(const char *zoneinfo_file) >X { >X@@ -526,7 +543,7 @@ >X else >X snprintf(prompt, sizeof(prompt), >X "Creating symbolic link %s to %s", >X- path_localtime, zoneinfo_file); >X+ path_localtime, zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file); >X if (usedialog) >X dialog_notify(prompt); >X else >X@@ -534,6 +551,22 @@ >X #endif >X >X if (reallydoit) { >X+ if (zoneinfo_file == NULL) { >X+ if (unlink(path_localtime) < 0 && errno != ENOENT) { >X+ snprintf(title, sizeof(title), "Error"); >X+ snprintf(prompt, sizeof(prompt), >X+ "Could not delete %s: %s", path_localtime, >X+ strerror(errno)); >X+ if (usedialog) >X+ dialog_mesgbox(title, prompt, 8, 72); >X+ else >X+ fprintf(stderr, "%s\n", prompt); >X+ >X+ return (DITEM_FAILURE | DITEM_RECREATE); >X+ } >X+ return (DITEM_LEAVE_MENU); >X+ } >X+ >X if (copymode) { >X fd1 = open(zoneinfo_file, O_RDONLY, 0); >X if (fd1 < 0) { >X@@ -656,7 +689,7 @@ >X struct tm *tm; >X int rv; >X >X- setenv("TZ", filename, 1); >X+ setenv("TZ", filename == NULL ? "" : filename, 1); >X tzset(); >X tm = localtime(&t); >X >25aa59230e4eb211a79aefc8fd34a91c >exit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 156019
: 114370