mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 01:18:52 +00:00
Fix return value of load_cfg, from Thomas Adam.
This commit is contained in:
parent
47c097cb51
commit
8264e92b37
4
cfg.c
4
cfg.c
@ -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
|
* Load configuration file. Returns -1 for an error with a list of messages in
|
||||||
* causes. Note that causes must be initialised by the caller!
|
* 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)
|
load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
@ -86,7 +86,7 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
|
|||||||
|
|
||||||
if ((f = fopen(path, "rb")) == NULL) {
|
if ((f = fopen(path, "rb")) == NULL) {
|
||||||
cfg_add_cause(causes, "%s: %s", path, strerror(errno));
|
cfg_add_cause(causes, "%s: %s", path, strerror(errno));
|
||||||
return (-1);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
|
2
tmux.h
2
tmux.h
@ -1520,7 +1520,7 @@ extern int cfg_finished;
|
|||||||
extern int cfg_references;
|
extern int cfg_references;
|
||||||
extern struct causelist cfg_causes;
|
extern struct causelist cfg_causes;
|
||||||
void printflike2 cfg_add_cause(struct causelist *, const char *, ...);
|
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 *);
|
void show_cfg_causes(struct session *);
|
||||||
|
|
||||||
/* format.c */
|
/* format.c */
|
||||||
|
Loading…
Reference in New Issue
Block a user