summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>1999-02-01 02:36:24 +0000
committerMatthew Chapman <matty@samba.org>1999-02-01 02:36:24 +0000
commit90b708473887ac11ca81f5a056ae5d2c854cf616 (patch)
treef4695bbd27594dd8ec5d5bbe6c51d74bfdcc162c
parentf5ac863e5a5c8e3ca584881214ebfbc6976b7d7f (diff)
downloadsamba-90b708473887ac11ca81f5a056ae5d2c854cf616.tar.gz
samba-90b708473887ac11ca81f5a056ae5d2c854cf616.tar.bz2
samba-90b708473887ac11ca81f5a056ae5d2c854cf616.zip
Added init_nt_time function which initialises an NTTIME to -1.
(This used to be commit e1e3875057bed830fdc0aaa9c85f04a1479fd64a)
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/time.c16
2 files changed, 10 insertions, 7 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9dbf57d17e..c3843814f8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -341,6 +341,7 @@ struct tm *LocalTime(time_t *t);
time_t nt_time_to_unix(NTTIME *nt);
time_t interpret_long_date(char *p);
void unix_to_nt_time(NTTIME *nt, time_t t);
+void init_nt_time(NTTIME *nt);
void put_long_date(char *p,time_t t);
BOOL null_mtime(time_t mtime);
void put_dos_date(char *buf,int offset,time_t unixdate);
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 3cea1a3e14..85f6006389 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -298,13 +298,6 @@ void unix_to_nt_time(NTTIME *nt, time_t t)
{
double d;
- if (t==0)
- {
- nt->low = 0;
- nt->high = 0;
- return;
- }
-
/* this converts GMT to kludge-GMT */
t -= LocTimeDiff(t) - serverzone;
@@ -316,6 +309,15 @@ void unix_to_nt_time(NTTIME *nt, time_t t)
nt->low = (uint32)(d - ((double)nt->high)*4.0*(double)(1<<30));
}
+/****************************************************************************
+initialise an NTTIME to -1, which means "unknown" or "don't expire"
+****************************************************************************/
+
+void init_nt_time(NTTIME *nt)
+{
+ nt->high = 0x7FFFFFFF;
+ nt->low = 0xFFFFFFFF;
+}
/****************************************************************************
take an NTTIME structure, containing high / low time. convert to unix time.