mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Rename global configuration define.
This commit is contained in:
parent
3d2b7d5bce
commit
e323101ede
8
server.c
8
server.c
@ -169,13 +169,13 @@ server_start(int lockfd, char *lockfile)
|
|||||||
cfg_references = 1;
|
cfg_references = 1;
|
||||||
ARRAY_INIT(&cfg_causes);
|
ARRAY_INIT(&cfg_causes);
|
||||||
|
|
||||||
if (access(SYSTEM_CFG, R_OK) == 0) {
|
if (access(TMUX_CONF, R_OK) == 0) {
|
||||||
if (load_cfg(SYSTEM_CFG, cfg_cmd_q, &cause) == -1) {
|
if (load_cfg(TMUX_CONF, cfg_cmd_q, &cause) == -1) {
|
||||||
xasprintf(&cause, "%s: %s", SYSTEM_CFG, cause);
|
xasprintf(&cause, "%s: %s", TMUX_CONF, cause);
|
||||||
ARRAY_ADD(&cfg_causes, cause);
|
ARRAY_ADD(&cfg_causes, cause);
|
||||||
}
|
}
|
||||||
} else if (errno != ENOENT) {
|
} 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);
|
ARRAY_ADD(&cfg_causes, cause);
|
||||||
}
|
}
|
||||||
if (cfg_file != NULL) {
|
if (cfg_file != NULL) {
|
||||||
|
2
tmux.c
2
tmux.c
@ -357,7 +357,7 @@ main(int argc, char **argv)
|
|||||||
if (pw != NULL)
|
if (pw != NULL)
|
||||||
home = pw->pw_dir;
|
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) {
|
if (access(cfg_file, R_OK) != 0 && errno == ENOENT) {
|
||||||
free(cfg_file);
|
free(cfg_file);
|
||||||
cfg_file = NULL;
|
cfg_file = NULL;
|
||||||
|
5
tmux.h
5
tmux.h
@ -43,9 +43,8 @@
|
|||||||
extern char *__progname;
|
extern char *__progname;
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
/* Default configuration files. */
|
/* Default global configuration file. */
|
||||||
#define DEFAULT_CFG ".tmux.conf"
|
#define TMUX_CONF "/etc/tmux.conf"
|
||||||
#define SYSTEM_CFG "/etc/tmux.conf"
|
|
||||||
|
|
||||||
/* Default prompt history length. */
|
/* Default prompt history length. */
|
||||||
#define PROMPT_HISTORY 100
|
#define PROMPT_HISTORY 100
|
||||||
|
Loading…
x
Reference in New Issue
Block a user