version 1.18, 2012/11/27 16:12:29 |
version 1.19, 2012/11/27 22:59:34 |
|
|
* 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; |
|
|
|
|
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; |
|
|