diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-10 19:37:35 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-10 19:37:35 +0000 |
commit | 4d711648263372e06928d1c495efb220c7b804d3 (patch) | |
tree | ba1fd7a3ce506332abad9d3e4101fd03b5e69b9d /server.c | |
parent | 88ab74ac20ad96771a9f06667da666bf85cd3f23 (diff) | |
download | rtmux-4d711648263372e06928d1c495efb220c7b804d3.tar.gz rtmux-4d711648263372e06928d1c495efb220c7b804d3.tar.bz2 rtmux-4d711648263372e06928d1c495efb220c7b804d3.zip |
Pick up cwd from environment,.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.92 2009-01-10 19:35:40 nicm Exp $ */ +/* $Id: server.c,v 1.93 2009-01-10 19:37:35 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -101,7 +101,7 @@ server_start(const char *path) * Must daemonise before loading configuration as the PID changes so * $TMUX would be wrong for sessions created in the config file. */ - if (daemon(1, 1) != 0) + if (daemon(0, 1) != 0) fatal("daemon failed"); ARRAY_INIT(&windows); @@ -590,6 +590,9 @@ server_lost_client(struct client *c) xfree(ARRAY_ITEM(&c->prompt_hdata, i)); ARRAY_FREE(&c->prompt_hdata); + if (c->cwd != NULL) + xfree(c->cwd); + close(c->fd); buffer_destroy(c->in); buffer_destroy(c->out); |