summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-04-24 10:01:32 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-04-24 10:01:32 +0000
commite323101edede281b65e3c7141d79afdb2501a8ea (patch)
tree2a187fa8243af48d4b7195caa798be19da318a38
parent3d2b7d5bce9532cedd647ace319afbf95ebe0e20 (diff)
Rename global configuration define.
-rw-r--r--server.c8
-rw-r--r--tmux.c2
-rw-r--r--tmux.h5
3 files changed, 7 insertions, 8 deletions
diff --git a/server.c b/server.c
index a07fa1fd..ffc25db0 100644
--- a/server.c
+++ b/server.c
@@ -169,13 +169,13 @@ server_start(int lockfd, char *lockfile)
cfg_references = 1;
ARRAY_INIT(&cfg_causes);
- if (access(SYSTEM_CFG, R_OK) == 0) {
- if (load_cfg(SYSTEM_CFG, cfg_cmd_q, &cause) == -1) {
- xasprintf(&cause, "%s: %s", SYSTEM_CFG, cause);
+ if (access(TMUX_CONF, R_OK) == 0) {
+ if (load_cfg(TMUX_CONF, cfg_cmd_q, &cause) == -1) {
+ xasprintf(&cause, "%s: %s", TMUX_CONF, cause);
ARRAY_ADD(&cfg_causes, cause);
}
} else if (errno != ENOENT) {
- xasprintf(&cause, "%s: %s", SYSTEM_CFG, strerror(errno));
+ xasprintf(&cause, "%s: %s", TMUX_CONF, strerror(errno));
ARRAY_ADD(&cfg_causes, cause);
}
if (cfg_file != NULL) {
diff --git a/tmux.c b/tmux.c
index e9b28d7e..b229967d 100644
--- a/tmux.c
+++ b/tmux.c
@@ -357,7 +357,7 @@ main(int argc, char **argv)
if (pw != NULL)
home = pw->pw_dir;
}
- xasprintf(&cfg_file, "%s/%s", home, DEFAULT_CFG);
+ xasprintf(&cfg_file, "%s/.tmux.conf", home);
if (access(cfg_file, R_OK) != 0 && errno == ENOENT) {
free(cfg_file);
cfg_file = NULL;
diff --git a/tmux.h b/tmux.h
index 8fb06223..7404b27f 100644
--- a/tmux.h
+++ b/tmux.h
@@ -43,9 +43,8 @@
extern char *__progname;
extern char **environ;
-/* Default configuration files. */
-#define DEFAULT_CFG ".tmux.conf"
-#define SYSTEM_CFG "/etc/tmux.conf"
+/* Default global configuration file. */
+#define TMUX_CONF "/etc/tmux.conf"
/* Default prompt history length. */
#define PROMPT_HISTORY 100