summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2007-05-21 16:01:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:16 -0500
commit0afd56aa837527941560118d8d156032fb8a2e8d (patch)
tree4e2bf94aea11a9e2a7a186688f1bb4d2999b8d64
parent1f907b4957ee3e1b30e5c84b9194d335375ec08e (diff)
downloadsamba-0afd56aa837527941560118d8d156032fb8a2e8d.tar.gz
samba-0afd56aa837527941560118d8d156032fb8a2e8d.tar.bz2
samba-0afd56aa837527941560118d8d156032fb8a2e8d.zip
r23041: Remainder of fix for 4630: fix special case of unix_to_nt_time() for
TIME_T_MAX, and also display of it in http_timestring() (This used to be commit 2553b6a56d20ef6273001ae3b090e156e676592c)
-rw-r--r--source3/lib/time.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index ae7f97790d..ee44f5eb13 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -95,7 +95,13 @@ void unix_to_nt_time(NTTIME *nt, time_t t)
if (t == (time_t)-1) {
*nt = (NTTIME)-1LL;
return;
- }
+ }
+
+ if (t == TIME_T_MAX) {
+ *nt = 0x7fffffffffffffffLL;
+ return;
+ }
+
if (t == 0) {
*nt = 0;
return;
@@ -301,7 +307,9 @@ char *http_timestring(time_t t)
static fstring buf;
struct tm *tm = localtime(&t);
- if (!tm) {
+ if (t == TIME_T_MAX) {
+ slprintf(buf,sizeof(buf)-1,"never");
+ } else if (!tm) {
slprintf(buf,sizeof(buf)-1,"%ld seconds since the Epoch",(long)t);
} else {
#ifndef HAVE_STRFTIME