summaryrefslogtreecommitdiff
path: root/src/date.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-08-07 22:04:01 +0000
committerJim Meyering <jim@meyering.net>2002-08-07 22:04:01 +0000
commit1f6174e4660ddaf10fdb0e2d6168a3f3dc9227ac (patch)
treedb5c47c27042a3e82ffc1b65dffbc41b66d24400 /src/date.c
parent8f5baf053eed7b3c816d136df7a5a0d3393564e0 (diff)
downloadcoreutils-1f6174e4660ddaf10fdb0e2d6168a3f3dc9227ac.tar.xz
(main): Adjust to posixtime signature change.
Diffstat (limited to 'src/date.c')
-rw-r--r--src/date.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/date.c b/src/date.c
index ca541b193..bce6a29fa 100644
--- a/src/date.c
+++ b/src/date.c
@@ -411,7 +411,7 @@ argument must be a format string beginning with `+'."),
}
else
{
- bool invalid_date = false;
+ bool valid_date = true;
status = 0;
if (!option_specified_date && !set_date)
@@ -422,11 +422,11 @@ argument must be a format string beginning with `+'."),
given in the POSIX-format. */
set_date = 1;
datestr = argv[optind];
- when.tv_sec = posixtime (datestr,
- (PDS_TRAILING_YEAR
- | PDS_CENTURY | PDS_SECONDS));
+ valid_date = posixtime (&when.tv_sec,
+ datestr,
+ (PDS_TRAILING_YEAR
+ | PDS_CENTURY | PDS_SECONDS));
when.tv_nsec = 0; /* FIXME: posixtime should set this. */
- invalid_date = (when.tv_sec == (time_t) -1);
format = NULL;
}
else
@@ -452,13 +452,13 @@ argument must be a format string beginning with `+'."),
{
when.tv_sec = get_date (datestr, NULL);
when.tv_nsec = 0; /* FIXME: get_date should set this. */
- invalid_date = (when.tv_sec == (time_t) -1);
+ valid_date = (when.tv_sec != (time_t) -1);
}
format = (n_args == 1 ? argv[optind] + 1 : NULL);
}
- if (invalid_date)
+ if (! valid_date)
error (1, 0, _("invalid date `%s'"), datestr);
if (set_date)