diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:37 +0000 |
commit | b6b00dd55e035bfbe311a527b567962ffa77ee43 (patch) | |
tree | cafc4d13785448e5a78bd40a51697ee07f07ac12 /libmisc/tz.c | |
parent | Adding debian version 1:4.13+dfsg1-5. (diff) | |
download | shadow-b6b00dd55e035bfbe311a527b567962ffa77ee43.tar.xz shadow-b6b00dd55e035bfbe311a527b567962ffa77ee43.zip |
Merging upstream version 1:4.15.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmisc/tz.c')
-rw-r--r-- | libmisc/tz.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/libmisc/tz.c b/libmisc/tz.c deleted file mode 100644 index 16d92ad..0000000 --- a/libmisc/tz.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SPDX-FileCopyrightText: 1991 - 1994, Julianne Frances Haugh - * SPDX-FileCopyrightText: 1991 - 1994, Chip Rosenthal - * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz - * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko - * SPDX-FileCopyrightText: 2007 - 2010, Nicolas François - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include <config.h> - -#ifndef USE_PAM - -#ident "$Id$" - -#include <stdio.h> -#include <string.h> -#include "defines.h" -#include "prototypes.h" -#include "getdef.h" - -/* - * tz - return local timezone name - * - * tz() determines the name of the local timezone by reading the - * contents of the file named by ``fname''. - */ -/*@observer@*/const char *tz (const char *fname) -{ - FILE *fp = NULL; - static char tzbuf[BUFSIZ]; - const char *def_tz = "TZ=CST6CDT"; - - fp = fopen (fname, "r"); - if ( (NULL == fp) - || (fgets (tzbuf, (int) sizeof (tzbuf), fp) == NULL)) { - def_tz = getdef_str ("ENV_TZ"); - if ((NULL == def_tz) || ('/' == def_tz[0])) { - def_tz = "TZ=CST6CDT"; - } - - strcpy (tzbuf, def_tz); - } else { - tzbuf[strlen (tzbuf) - 1] = '\0'; - } - - if (NULL != fp) { - (void) fclose (fp); - } - - return tzbuf; -} -#else /* !USE_PAM */ -extern int errno; /* warning: ANSI C forbids an empty source file */ -#endif /* !USE_PAM */ - |