use putenv (Sys 5 standard) instead of setenv (completely nonstandard)
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 6 May 1992 23:56:59 +0000 (15:56 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 6 May 1992 23:56:59 +0000 (15:56 -0800)
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.48

usr/src/usr.sbin/sendmail/src/main.c

index 583fddf..a707167 100644 (file)
@@ -13,7 +13,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.47 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.48 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -151,7 +151,12 @@ main(argc, argv, envp)
        if (TimeZoneSpec == NULL)
                unsetenv("TZ");
        else if (TimeZoneSpec[0] != '\0')
        if (TimeZoneSpec == NULL)
                unsetenv("TZ");
        else if (TimeZoneSpec[0] != '\0')
-               setenv("TZ", TimeZoneSpec);
+       {
+               p = xalloc(strlen(TimeZoneSpec) + 4);
+               (void) strcpy(p, "TZ=");
+               (void) strcat(p, TimeZoneSpec);
+               putenv(p);
+       }
 #else
        /* enforce use of kernel-supplied time zone information */
        unsetenv("TZ");
 #else
        /* enforce use of kernel-supplied time zone information */
        unsetenv("TZ");