aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-10-31 10:01:12 +0000
committerThomas Adam <thomas@xteddy.org>2015-10-31 10:01:12 +0000
commit17f6c3be8eeb0b67d07f916026dab918795c0317 (patch)
tree08a10a780a8de977d4452c10a7a9c03db1ae1702 /session.c
parente8bb385d6d9d8a91b5fa78e906531afc02320b80 (diff)
parent01defc9f4965bb174e1d1295754d5a8695683054 (diff)
downloadrtmux-17f6c3be8eeb0b67d07f916026dab918795c0317.tar.gz
rtmux-17f6c3be8eeb0b67d07f916026dab918795c0317.tar.bz2
rtmux-17f6c3be8eeb0b67d07f916026dab918795c0317.zip
Merge branch 'obsd-master'
Diffstat (limited to 'session.c')
-rw-r--r--session.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/session.c b/session.c
index 9f086bbd..e4dadc97 100644
--- a/session.c
+++ b/session.c
@@ -103,8 +103,8 @@ session_find_by_id(u_int id)
/* Create a new session. */
struct session *
session_create(const char *name, int argc, char **argv, const char *path,
- int cwd, struct environ *env, struct termios *tio, int idx, u_int sx,
- u_int sy, char **cause)
+ const char *cwd, struct environ *env, struct termios *tio, int idx,
+ u_int sx, u_int sy, char **cause)
{
struct session *s;
struct winlink *wl;
@@ -113,7 +113,7 @@ session_create(const char *name, int argc, char **argv, const char *path,
s->references = 1;
s->flags = 0;
- s->cwd = dup(cwd);
+ s->cwd = xstrdup(cwd);
s->curw = NULL;
TAILQ_INIT(&s->lastw);
@@ -223,7 +223,7 @@ session_destroy(struct session *s)
winlink_remove(&s->windows, wl);
}
- close(s->cwd);
+ free((void *)s->cwd);
session_unref(s);
}
@@ -314,7 +314,7 @@ session_previous_session(struct session *s)
/* Create a new window on a session. */
struct winlink *
session_new(struct session *s, const char *name, int argc, char **argv,
- const char *path, int cwd, int idx, char **cause)
+ const char *path, const char *cwd, int idx, char **cause)
{
struct window *w;
struct winlink *wl;