summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-12 09:14:26 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-12 09:14:26 +0000
commit055698d913f2dab1954c11d1e1519de672098990 (patch)
tree0e69bd3280e4c3c208d481c63bd90c9c7b473655 /usr.bin/tmux/tmux.c
parentaf3ddbaa22c79abbc7ab905ee17b964ebca7fc30 (diff)
When started as the shell, __progname contains a leading -, so hardcode "tmux"
for socket path and log files, and strip it when working out the shell.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index ccdf009ca83..6fc6028e299 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.31 2009/08/11 17:18:35 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.32 2009/08/12 09:14:25 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -79,8 +79,7 @@ logfile(const char *name)
log_close();
if (debug_level > 0) {
- xasprintf(
- &path, "%s-%s-%ld.log", __progname, name, (long) getpid());
+ xasprintf(&path, "tmux-%s-%ld.log", name, (long) getpid());
log_open_file(debug_level, path);
xfree(path);
}
@@ -184,7 +183,7 @@ makesockpath(const char *label)
u_int uid;
uid = getuid();
- xsnprintf(base, MAXPATHLEN, "%s/%s-%d", _PATH_TMP, __progname, uid);
+ xsnprintf(base, MAXPATHLEN, "%s/tmux-%d", _PATH_TMP, uid);
if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST)
return (NULL);