Print this page
4337 eliminate /etc/TIMEZONE

@@ -19,19 +19,20 @@
  *
  * CDDL HEADER END
  */
 
 /*
+ * Copyright 2014 Garrett D'Amore
+ */
+/*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
 /*        All Rights Reserved   */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 /*
  * Network Listener Process
  *
  *              command line:
  *

@@ -155,11 +156,11 @@
 static char *nologfile = "Unable to open listener log file during initialization";
 static char *usage     = "Usage: listen [ -m minor_prefix ] network_device";
 static char *nopmtag   = "Fatal error: Unable to get PMTAG from environment";
 static char tzenv[BUFSIZ];
 
-#define TIMEZONE        "/etc/TIMEZONE"
+#define TZFILE  "/etc/default/init"
 #define TZSTR   "TZ="
 
 void    check_sac_mesg();       /* routine to process messages from sac */
 void    rpc_register();         /* routine to register rpc services */
 void    rpc_unregister();       /* routine to unregister rpc services */

@@ -298,11 +299,11 @@
  * In case we started with no environment, find out what timezone we're
  * in.  This will get passed to children, so only need to do once.
  */
 
         if (getenv("TZ") == NULL) {
-                fp = fopen(TIMEZONE, "r");
+                fp = fopen(TZFILE, "r");
                 if (fp) {
                         while (fgets(tzenv, BUFSIZ, fp)) {
                                 if (tzenv[strlen(tzenv) - 1] == '\n')
                                         tzenv[strlen(tzenv) - 1] = '\0';
                                 if (!strncmp(TZSTR, tzenv, strlen(TZSTR))) {

@@ -311,11 +312,12 @@
                                 }
                         }
                         fclose(fp);
                 }
                 else {
-                        sprintf(scratch, "couldn't open %s, default to GMT", TIMEZONE);
+                        sprintf(scratch, "couldn't open %s, default to GMT",
+                            TZFILE);
                         logmessage(scratch);
                 }
         }
 
         logmessage("@(#)listen:listen.c 1.19.9.1");

@@ -1569,12 +1571,12 @@
         if ((*p == '"') || (*p == '\'')) {
                 /* it is quoted */
                 delim = *p++;
                 for (;;) {
                         if (*p == '\0') {
-                                /* etc/TIMEZONE ill-formed, go without TZ */
-                                sprintf(scratch, "%s ill-formed", TIMEZONE);
+                                /* etc/default/init ill-formed, go without TZ */
+                                sprintf(scratch, "%s ill-formed", TZFILE);
                                 logmessage(scratch);
                                 strcpy(s, "TZ=");
                                 return(s);
                         }
                         if (*p == delim) {