aboutsummaryrefslogtreecommitdiffstats
path: root/unix.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-07 17:33:02 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-07 17:33:02 +0100
commitdaae10fbfe16bac26f74af91faf253d377f1b166 (patch)
treee7870e81be568ab10abcc1bf8639a9191dbbb9c1 /unix.c
parent289bd2d47ff58f42879ad50ebbc1b193831e4a78 (diff)
OpenSolaris (non-gcc) fixes, patches from Dagobert Michelsen <dam@opencsw.org>
with some changes.
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/unix.c b/unix.c
index 38366111..c3ecbc99 100644
--- a/unix.c
+++ b/unix.c
@@ -158,12 +158,15 @@ int main( int argc, char *argv[] )
if( global.restart )
{
char *fn = ipc_master_save_state();
+ char *env;
- chdir( old_cwd );
-
- setenv( "_BITLBEE_RESTART_STATE", fn, 1 );
+ env = g_strdup_printf( "_BITLBEE_RESTART_STATE=%s", fn );
+ putenv( env );
g_free( fn );
+ /* Looks like env should *not* be freed here as putenv
+ doesn't make a copy. Odd. */
+ chdir( old_cwd );
close( global.listen_socket );
if( execv( argv[0], argv ) == -1 )