From: Christopher Faylor Date: Thu, 25 Sep 2003 03:51:51 +0000 (+0000) Subject: * include/tzfile.h: Add some missing entries. X-Git-Tag: corinna-01~187 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=cd2bce7142ff77e1e55149e5edfe04167b4e8964;p=newlib-cygwin.git * include/tzfile.h: Add some missing entries. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2b1b7fcd9..bc23adaf8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2003-09-24 Christopher Faylor + + * include/tzfile.h: Add some missing entries. + 2003-09-24 Christopher Faylor * include/paths.h: Add some missing entries. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index fe2f0564f..5ff45df4d 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -247,7 +247,7 @@ fhandler_socket::check_peer_secret_event (struct sockaddr_in* peer, int* secret) DWORD rc = WaitForSingleObject (ev, 10000); debug_printf ("WFSO rc=%d", rc); CloseHandle (ev); - return (rc == WAIT_OBJECT_0 ? 1 : 0 ); + return (rc == WAIT_OBJECT_0 ? 1 : 0); } else return 0; @@ -530,7 +530,7 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen) { if (!check_peer_secret_event (&sin, secret)) { - debug_printf ( "accept from unauthorized server" ); + debug_printf ("accept from unauthorized server"); secret_check_failed = TRUE; } } diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 9804a9a1b..d0499f236 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -1125,7 +1125,7 @@ fhandler_tty_common::close () /* Send EOF to slaves if master side is closed */ if (!get_ttyp ()->master_alive ()) { - termios_printf ("no more masters left. sending EOF" ); + termios_printf ("no more masters left. sending EOF"); SetEvent (input_available_event); } diff --git a/winsup/cygwin/include/tzfile.h b/winsup/cygwin/include/tzfile.h index 4d3e11cb9..870c1bbd0 100644 --- a/winsup/cygwin/include/tzfile.h +++ b/winsup/cygwin/include/tzfile.h @@ -1,6 +1,6 @@ /* tzfile.h - Copyright 2001 Red Hat, Inc. + Copyright 2001, 2002, 2003 Red Hat, Inc. This file is part of Cygwin. @@ -11,9 +11,42 @@ details. */ #ifndef _TZFILE_H #define _TZFILE_H -#define SECSPERDAY (60*60*24) +#define SECSPERMIN 60 +#define MINSPERHOUR 60 +#define HOURSPERDAY 24 +#define DAYSPERWEEK 7 #define DAYSPERNYEAR 365 -#define DAYSPERLYEAR 366 +#define DAYSPERLYEAR 366 +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) +#define MONSPERYEAR 12 + +#define TM_SUNDAY 0 +#define TM_MONDAY 1 +#define TM_TUESDAY 2 +#define TM_WEDNESDAY 3 +#define TM_THURSDAY 4 +#define TM_FRIDAY 5 +#define TM_SATURDAY 6 + +#define TM_JANUARY 0 +#define TM_FEBRUARY 1 +#define TM_MARCH 2 +#define TM_APRIL 3 +#define TM_MAY 4 +#define TM_JUNE 5 +#define TM_JULY 6 +#define TM_AUGUST 7 +#define TM_SEPTEMBER 8 +#define TM_OCTOBER 9 +#define TM_NOVEMBER 10 +#define TM_DECEMBER 11 +#define TM_SUNDAY 0 + +#define TM_YEAR_BASE 1900 + +#define EPOCH_YEAR 1970 +#define EPOCH_WDAY TM_THURSDAY #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) #endif diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 670e19bb1..040760685 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -163,7 +163,7 @@ cygsid::getfromstr (const char *nsidstr) if (nsidstr && !strncmp (nsidstr, "S-1-", 4)) { s = strtoul (nsidstr + 4, &lasts, 10); - while ( cnt < 8 && *lasts == '-') + while (cnt < 8 && *lasts == '-') r[cnt++] = strtoul (lasts + 1, &lasts, 10); if (!*lasts) return get_sid (s, cnt, r); diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 3abe221f4..9b8c6da0a 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1745,7 +1745,7 @@ alloc_sd (__uid32_t uid, __gid32_t gid, int attribute, } /* Construct appropriate inherit attribute for new directories */ - if (S_ISDIR (attribute) && !acl_exists ) + if (S_ISDIR (attribute) && !acl_exists) { const DWORD inherit = SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY; diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index ed73fded7..a7e25ea46 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -82,7 +82,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp) } DWORD resolution = gtod.resolution (); DWORD req = ((rqtp->tv_sec * 1000 + (rqtp->tv_nsec + 999999) / 1000000 - + resolution - 1) / resolution ) * resolution; + + resolution - 1) / resolution) * resolution; DWORD end_time = gtod.dmsecs () + req; syscall_printf ("nanosleep (%ld)", req); diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 23939b95c..e10824442 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -1574,7 +1574,7 @@ pthread_mutex::_trylock (pthread_t self) { int result = 0; - if (InterlockedCompareExchange ((long *)&lock_counter, 1, 0 ) == 0) + if (InterlockedCompareExchange ((long *) &lock_counter, 1, 0) == 0) set_owner (self); else if (type == PTHREAD_MUTEX_RECURSIVE && pthread::equal (owner, self)) result = lock_recursive ();