summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2021-10-28 10:18:17 +0200
committerJeremy Allison <jra@samba.org>2021-10-28 18:11:28 +0000
commit5503bde93bddf3634b183e665773399c110251d4 (patch)
tree073e504333f48f40a54612a73b2b7683ca81fc54 /lib
parente2740e4868f2a49877a86a8666d26226b5657317 (diff)
downloadsamba-5503bde93bddf3634b183e665773399c110251d4.tar.gz
lib: update null_nttime() of -1: -1 is NTTIME_FREEZE
NTTIME_FREEZE is not a nil sentinel value, instead it implies special, yet unimplemented semantics. Callers must deal with those values specifically and null_nttime() must not lie about their nature. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14127 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/util/tests/time.c2
-rw-r--r--lib/util/time.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/util/tests/time.c b/lib/util/tests/time.c
index ee1fd42c8cf..33930a77173 100644
--- a/lib/util/tests/time.c
+++ b/lib/util/tests/time.c
@@ -35,7 +35,7 @@ static bool test_null_time(struct torture_context *tctx)
static bool test_null_nttime(struct torture_context *tctx)
{
torture_assert(tctx, null_nttime(0), "0");
- torture_assert(tctx, null_nttime(NTTIME_FREEZE), "-1");
+ torture_assert(tctx, !null_nttime(NTTIME_FREEZE), "-1");
torture_assert(tctx, !null_nttime(42), "42");
return true;
}
diff --git a/lib/util/time.c b/lib/util/time.c
index 53bf194fe0b..e6a0668cf90 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -178,7 +178,7 @@ check if it's a null NTTIME
**/
_PUBLIC_ bool null_nttime(NTTIME t)
{
- return t == 0 || t == (NTTIME)-1;
+ return t == 0;
}
/*******************************************************************