Sourceware Bugzilla – Attachment 8788 Details for
Bug 19253
tzset() ineffective when temporary TZ did not include DST rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Demo program
tz-quirk.c (text/x-csrc), 686 bytes, created by
Martin Panter
on 2015-11-16 23:14:34 UTC
(
hide
)
Description:
Demo program
Filename:
MIME Type:
Creator:
Martin Panter
Created:
2015-11-16 23:14:34 UTC
Size:
686 bytes
patch
obsolete
>#include <stdio.h> >#include <time.h> >#include <stdlib.h> > >void dump(const char *msg) { > printf("%s: TZ=", msg); > const char *tz = getenv("TZ"); > if(0 == tz) { > printf("<unset>"); > } else { > printf("\"%s\"", tz); > } > printf(" tzname={\"%s\", \"%s\"}\n", tzname[0], tzname[1]); >} > >int main(int argc, char **argv) { > dump("Initially"); > > tzset(); > dump("After tzset()"); > > if(setenv("TZ", argv[1], 1) < 0) { > perror("setenv()"); > return 1; > } > tzset(); > dump("Set TZ"); > > if(unsetenv("TZ") < 0) { > perror("unsetenv()"); > return 1; > } > tzset(); > dump("Unset TZ"); > > return 0; >}
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 19253
: 8788