summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-11-27 22:59:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-11-27 22:59:35 +0000
commit4a4758756cda53d077d54b56b6bac6d4521de516 (patch)
tree7eff27ea71cccf88a13e4316519d1f0b87b22fca
parentcc583e5ed1b32ad86428df0ca92f0d9150317889 (diff)
Fix return value of load_cfg, from Thomas Adam.
-rw-r--r--usr.bin/tmux/cfg.c6
-rw-r--r--usr.bin/tmux/tmux.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c
index abf4af34afd..1fab3dec126 100644
--- a/usr.bin/tmux/cfg.c
+++ b/usr.bin/tmux/cfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfg.c,v 1.18 2012/11/27 16:12:29 nicm Exp $ */
+/* $OpenBSD: cfg.c,v 1.19 2012/11/27 22:59:34 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -73,7 +73,7 @@ cfg_add_cause(struct causelist *causes, const char *fmt, ...)
* Load configuration file. Returns -1 for an error with a list of messages in
* causes. Note that causes must be initialised by the caller!
*/
-int
+enum cmd_retval
load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
{
FILE *f;
@@ -86,7 +86,7 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
if ((f = fopen(path, "rb")) == NULL) {
cfg_add_cause(causes, "%s: %s", path, strerror(errno));
- return (-1);
+ return (CMD_RETURN_ERROR);
}
n = 0;
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 8d88176bf6f..2bad9a5d43d 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.367 2012/11/27 20:22:12 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.368 2012/11/27 22:59:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1520,7 +1520,7 @@ extern int cfg_finished;
extern int cfg_references;
extern struct causelist cfg_causes;
void printflike2 cfg_add_cause(struct causelist *, const char *, ...);
-int load_cfg(const char *, struct cmd_ctx *, struct causelist *);
+enum cmd_retval load_cfg(const char *, struct cmd_ctx *, struct causelist *);
void show_cfg_causes(struct session *);
/* format.c */