Skip to content

Commit

Permalink
Remove the timezone() function.
Browse files Browse the repository at this point in the history
It conflicts with an XSI extension where timezone and daylight are
variables representing:

timezone:  the difference, in seconds, between Coordinated Universal
Time (UTC) and local standard time.

daylight:  set to 0 if Daylight Savings Time conversions should never be
applied for the timezone in use; otherwise, non-zero.
  • Loading branch information
Peter Avalos committed Apr 7, 2009
1 parent c5f2988 commit 7d013f9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 205 deletions.
2 changes: 2 additions & 0 deletions Makefile_upgrade.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1062,3 +1062,5 @@ TO_REMOVE+=/usr/share/man/man8/iwicontrol.8.gz
TO_REMOVE+=/usr/share/man/cat8/iwicontrol.8.gz
TO_REMOVE+=/usr/share/man/man9/objcache_reclaim_list.9.gz
TO_REMOVE+=/usr/share/man/cat9/objcache_reclaim_list.9.gz
TO_REMOVE+=/usr/share/man/cat3/timezone.3.gz
TO_REMOVE+=/usr/share/man/man3/timezone.3.gz
3 changes: 2 additions & 1 deletion include/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,12 @@ int nanosleep (const struct timespec *, struct timespec *);
#endif /* __POSIX_VISIBLE >= 199309 */

#if __XSI_VISIBLE
extern int daylight;
extern long timezone;
char *strptime (const char *, const char *, struct tm *);
#endif

#if __BSD_VISIBLE
char *timezone (int, int);
void tzsetwall (void);
time_t timelocal (struct tm * const);
time_t timegm (struct tm * const);
Expand Down
4 changes: 2 additions & 2 deletions lib/libc/gen/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SRCS+= _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
signbitd.c signbitf.c sigsetops.c sigwait.c sleep.c srand48.c \
stringlist.c strtofflags.c sysconf.c sysctl.c sysctlbyname.c \
sysctlnametomib.c syslog.c telldir.c termios.c time.c times.c \
timezone.c toascii.c tolower.c toupper.c ttyname.c ttyslot.c \
toascii.c tolower.c toupper.c ttyname.c ttyslot.c \
ualarm.c ucontext.c ulimit.c uname.c unvis.c usleep.c utime.c \
valloc.c vis.c wait.c wait3.c waitpid.c wordexp.c

Expand Down Expand Up @@ -72,7 +72,7 @@ MAN+= alarm.3 arc4random.3 clock.3 \
scandir.3 setjmp.3 setmode.3 setproctitle.3 shm_open.3 \
siginterrupt.3 signal.3 signbit.3 sigsetops.3 sleep.3 stringlist.3 \
strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 \
tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 timezone.3 \
tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 \
toascii.3 tolower.3 toupper.3 ttyname.3 tzset.3 ualarm.3 \
ucontext.3 ulimit.3 uname.3 unvis.3 usleep.3 utime.3 \
valloc.3 vis.3 wordexp.3
Expand Down
72 changes: 0 additions & 72 deletions lib/libc/gen/timezone.3

This file was deleted.

130 changes: 0 additions & 130 deletions lib/libc/gen/timezone.c

This file was deleted.

9 changes: 9 additions & 0 deletions lib/libc/stdtime/localtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ char * tzname[2] = {

static struct tm tm;

time_t timezone = 0;
int daylight = 0;

static long
detzcode(const char * const codep)
{
Expand Down Expand Up @@ -243,12 +246,18 @@ settzname(void)

tzname[0] = wildabbr;
tzname[1] = wildabbr;
daylight = 0;
timezone = 0;

for (i = 0; i < sp->typecnt; ++i) {
const struct ttinfo * const ttisp = &sp->ttis[i];

tzname[ttisp->tt_isdst] =
&sp->chars[ttisp->tt_abbrind];
if (ttisp->tt_isdst)
daylight = 1;
if (i == 0 || !ttisp->tt_isdst)
timezone = -(ttisp->tt_gmtoff);
}
/*
** And to get the latest zone names into tzname. . .
Expand Down

0 comments on commit 7d013f9

Please sign in to comment.