@@ -1229,16 +1229,16 @@ parse_time(const char *value, time_t *result, bool utc_default)
12291229 */
12301230 if (tz_set || utc_default )
12311231 /* set timezone to UTC */
1232- setenv ("TZ" , "UTC" , 1 );
1232+ pgut_setenv ("TZ" , "UTC" );
12331233
12341234 /* convert time to utc unix time */
12351235 * result = mktime (& tm );
12361236
12371237 /* return old timezone back if any */
12381238 if (local_tz )
1239- setenv ("TZ" , local_tz , 1 );
1239+ pgut_setenv ("TZ" , local_tz );
12401240 else
1241- unsetenv ("TZ" );
1241+ pgut_unsetenv ("TZ" );
12421242
12431243 /* adjust time zone */
12441244 if (tz_set || utc_default )
@@ -1480,7 +1480,7 @@ time2iso(char *buf, size_t len, time_t time, bool utc)
14801480
14811481 /* set timezone to UTC if requested */
14821482 if (utc )
1483- setenv ("TZ" , "UTC" , 1 );
1483+ pgut_setenv ("TZ" , "UTC" );
14841484
14851485 ptm = gmtime (& time );
14861486 gmt = mktime (ptm );
@@ -1490,9 +1490,9 @@ time2iso(char *buf, size_t len, time_t time, bool utc)
14901490 {
14911491 /* return old timezone back if any */
14921492 if (local_tz )
1493- setenv ("TZ" , local_tz , 1 );
1493+ pgut_setenv ("TZ" , local_tz );
14941494 else
1495- unsetenv ("TZ" );
1495+ pgut_unsetenv ("TZ" );
14961496 }
14971497
14981498 /* adjust timezone offset */
0 commit comments