projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Accessor functions for app_data in ECDSA_METHOD
[oweals/openssl.git]
/
crypto
/
o_time.c
diff --git
a/crypto/o_time.c
b/crypto/o_time.c
index 8c9363396650a9e45cdff10d44df8a82a374793d..867ca5ec6e5a4eb81c03481b50e7169a3dd6bf84 100644
(file)
--- a/
crypto/o_time.c
+++ b/
crypto/o_time.c
@@
-61,15
+61,21
@@
#include <openssl/e_os2.h>
#include <string.h>
#include <openssl/e_os2.h>
#include <string.h>
-#include "
o_time
.h"
+#include "
crypto
.h"
#ifdef OPENSSL_SYS_VMS
#ifdef OPENSSL_SYS_VMS
-# include <libdtdef.h>
-# include <lib$routines.h>
-# include <lnmdef.h>
-# include <starlet.h>
-# include <descrip.h>
-# include <stdlib.h>
+# if __CRTL_VER >= 70000000 && \
+ (defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE)
+# define VMS_GMTIME_OK
+# endif
+# ifndef VMS_GMTIME_OK
+# include <libdtdef.h>
+# include <lib$routines.h>
+# include <lnmdef.h>
+# include <starlet.h>
+# include <descrip.h>
+# include <stdlib.h>
+# endif /* ndef VMS_GMTIME_OK */
#endif
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
#endif
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
@@
-81,7
+87,7
@@
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
so we don't even look at the return value */
gmtime_r(timer,result);
ts = result;
so we don't even look at the return value */
gmtime_r(timer,result);
ts = result;
-#elif !defined(OPENSSL_SYS_VMS)
+#elif !defined(OPENSSL_SYS_VMS)
|| defined(VMS_GMTIME_OK)
ts = gmtime(timer);
if (ts == NULL)
return NULL;
ts = gmtime(timer);
if (ts == NULL)
return NULL;
@@
-89,7
+95,7
@@
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
memcpy(result, ts, sizeof(struct tm));
ts = result;
#endif
memcpy(result, ts, sizeof(struct tm));
ts = result;
#endif
-#if
def OPENSSL_SYS_VMS
+#if
defined( OPENSSL_SYS_VMS) && !defined( VMS_GMTIME_OK)
if (ts == NULL)
{
static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL");
if (ts == NULL)
{
static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL");
@@
-228,7
+234,7
@@
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
static long date_to_julian(int y, int m, int d);
static void julian_to_date(long jd, int *y, int *m, int *d);
static long date_to_julian(int y, int m, int d);
static void julian_to_date(long jd, int *y, int *m, int *d);
-static int julian_adj(struct tm *tm, int off_day, long offset_sec,
+static int julian_adj(
const
struct tm *tm, int off_day, long offset_sec,
long *pday, int *psec);
int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
long *pday, int *psec);
int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
@@
-261,7
+267,8
@@
int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
}
}
-int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
+int OPENSSL_gmtime_diff(int *pday, int *psec,
+ const struct tm *from, const struct tm *to)
{
int from_sec, to_sec, diff_sec;
long from_jd, to_jd, diff_day;
{
int from_sec, to_sec, diff_sec;
long from_jd, to_jd, diff_day;
@@
-283,8
+290,10
@@
int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
diff_sec -= SECS_PER_DAY;
}
diff_sec -= SECS_PER_DAY;
}
- *pday = (int)diff_day;
- *psec = diff_sec;
+ if (pday)
+ *pday = (int)diff_day;
+ if (psec)
+ *psec = diff_sec;
return 1;
return 1;
@@
-292,7
+301,7
@@
int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
/* Convert tm structure and offset into julian day and seconds */
/* Convert tm structure and offset into julian day and seconds */
-static int julian_adj(struct tm *tm, int off_day, long offset_sec,
+static int julian_adj(
const
struct tm *tm, int off_day, long offset_sec,
long *pday, int *psec)
{
int offset_hms, offset_day;
long *pday, int *psec)
{
int offset_hms, offset_day;