summaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2018-08-30 21:09:43 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2018-08-30 21:09:43 +0000
commit6aa6b1c6e2c340e5bfe1e2b58951a3ccb03d77bd (patch)
tree69f86a19a62e2d32f569cd22f4f07c22aaef83ee /time
parent232cd26685361833b19d0dbe5d567abe02e005a7 (diff)
downloadapr-6aa6b1c6e2c340e5bfe1e2b58951a3ccb03d77bd.tar.gz
Revert 1839699, this contained unintended, additional noise. Re-correcting.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time')
-rw-r--r--time/win32/time.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/time/win32/time.c b/time/win32/time.c
index 6f4590541..1a705443b 100644
--- a/time/win32/time.c
+++ b/time/win32/time.c
@@ -54,6 +54,9 @@ static void SystemTimeToAprExpTime(apr_time_exp_t *xt, SYSTEMTIME *tm)
static const int dayoffset[12] =
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+ if (tm->wMonth < 1 || tm->wMonth > 12)
+ return APR_EBADDATE;
+
/* Note; the caller is responsible for filling in detailed tm_usec,
* tm_gmtoff and tm_isdst data when applicable.
*/
@@ -108,7 +111,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result,
FileTimeToSystemTime(&ft, &st);
/* The Platform SDK documents that SYSTEMTIME/FILETIME are
* generally UTC, so no timezone info needed
- * The time value makes a roundtrip, st cannot be invalid below.
*/
SystemTimeToAprExpTime(result, &st);
result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
@@ -125,7 +127,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result,
FileTimeToSystemTime(&ft, &st);
/* The Platform SDK documents that SYSTEMTIME/FILETIME are
* generally UTC, so we will simply note the offs used.
- * The time value makes a roundtrip, st cannot be invalid below.
*/
SystemTimeToAprExpTime(result, &st);
result->tm_usec = (apr_int32_t) (input % APR_USEC_PER_SEC);
@@ -157,7 +158,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
* because FileTimeToLocalFileFime is documented that the
* resulting time local file time would have DST relative
* to the *present* date, not the date converted.
- * The time value makes a roundtrip, localst cannot be invalid below.
*/
SystemTimeToTzSpecificLocalTime(tz, &st, &localst);
SystemTimeToAprExpTime(result, &localst);
@@ -187,7 +187,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
TIME_ZONE_INFORMATION tz;
/* XXX: This code is simply *wrong*. The time converted will always
* map to the *now current* status of daylight savings time.
- * The time value makes a roundtrip, st cannot be invalid below.
*/
FileTimeToLocalFileTime(&ft, &localft);
@@ -299,9 +298,6 @@ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
/* The Platform SDK documents that SYSTEMTIME/FILETIME are
* generally UTC, so no timezone info needed
*/
- if (tm->wMonth < 1 || tm->wMonth > 12)
- return APR_EBADDATE;
-
SystemTimeToAprExpTime(aprtime, *ostime);
return APR_SUCCESS;
}