aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2023-06-20 21:03:35 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2023-06-20 21:03:35 +0000
commit4a0b57b0b4cbf7eb848927cf3f493163c3e76142 (patch)
treec2ef201aadb8301a387f802fb21c0a4f02239165
parent824b64a2f1a05bd1a6176719f2d4c1a2e16d6d08 (diff)
downloadsrc-4a0b57b0b4cbf7eb848927cf3f493163c3e76142.tar.gz
src-4a0b57b0b4cbf7eb848927cf3f493163c3e76142.zip
fifolog: Trim some dead code and unused variables.
The gmt_ptr and gmt variables are not used, so the call to gmtime can be removed entirely. In addition, there isn't a need to call localtime twice. Reported by: GCC -Wunused-but-set-variable Reviewed by: phk, emaste Differential Revision: https://reviews.freebsd.org/D40656
-rw-r--r--usr.sbin/fifolog/lib/getdate.y14
1 files changed, 1 insertions, 13 deletions
diff --git a/usr.sbin/fifolog/lib/getdate.y b/usr.sbin/fifolog/lib/getdate.y
index 8e63e8112993..57f3cb1d46fb 100644
--- a/usr.sbin/fifolog/lib/getdate.y
+++ b/usr.sbin/fifolog/lib/getdate.y
@@ -818,30 +818,18 @@ yylex(void)
time_t
get_date(char *p)
{
- struct tm *tm, gmt;
+ struct tm *tm;
time_t Start;
time_t tod;
time_t nowtime;
- struct tm *gmt_ptr;
yyInput = p;
(void)time (&nowtime);
- gmt_ptr = gmtime (&nowtime);
- if (gmt_ptr != NULL)
- {
- /* Make a copy, in case localtime modifies *tm (I think
- that comment now applies to *gmt_ptr, but I am too
- lazy to dig into how gmtime and locatime allocate the
- structures they return pointers to). */
- gmt = *gmt_ptr;
- }
-
if (! (tm = localtime (&nowtime)))
return -1;
- tm = localtime(&nowtime);
yyYear = tm->tm_year + 1900;
yyMonth = tm->tm_mon + 1;
yyDay = tm->tm_mday;