-/* $OpenBSD: config.c,v 1.36 2015/02/23 11:48:41 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.37 2015/04/11 14:52:49 jsing Exp $ */
/*
* Copyright (c) 2011 - 2015 Reyk Floeter <reyk@openbsd.org>
fd = -1;
else if ((fd = dup(srv->srv_s)) == -1)
return (-1);
- proc_composev_imsg(ps, id, n,
- IMSG_CFG_SERVER, fd, iov, c);
+ if (proc_composev_imsg(ps, id, n,
+ IMSG_CFG_SERVER, fd, iov, c) != 0) {
+ log_warn("%s: failed to compose "
+ "IMSG_CFG_SERVER imsg for `%s'",
+ __func__, srv->srv_conf.name);
+ return (-1);
+ }
}
} else {
- proc_composev_imsg(ps, id, -1, IMSG_CFG_SERVER, -1,
- iov, c);
+ if (proc_composev_imsg(ps, id, -1, IMSG_CFG_SERVER, -1,
+ iov, c) != 0) {
+ log_warn("%s: failed to compose "
+ "IMSG_CFG_SERVER imsg for `%s'",
+ __func__, srv->srv_conf.name);
+ return (-1);
+ }
}
}
-/* $OpenBSD: logger.c,v 1.11 2015/02/08 00:00:59 reyk Exp $ */
+/* $OpenBSD: logger.c,v 1.12 2015/04/11 14:52:49 jsing Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
iov[1].iov_base = log->log_name;
iov[1].iov_len = strlen(log->log_name) + 1;
- proc_composev_imsg(env->sc_ps, PROC_PARENT, -1, IMSG_LOG_OPEN, -1,
- iov, 2);
+ if (proc_composev_imsg(env->sc_ps, PROC_PARENT, -1, IMSG_LOG_OPEN, -1,
+ iov, 2) != 0) {
+ log_warn("%s: failed to compose IMSG_LOG_OPEN imsg", __func__);
+ goto err;
+ }
TAILQ_INSERT_TAIL(&log_files, log, log_entry);
return (log);
+
+err:
+ free(log);
+
+ return (NULL);
}
int
-/* $OpenBSD: server.c,v 1.61 2015/03/15 22:08:45 florian Exp $ */
+/* $OpenBSD: server.c,v 1.62 2015/04/11 14:52:49 jsing Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
iov[1].iov_base = msg;
iov[1].iov_len = strlen(msg) + 1;
- proc_composev_imsg(env->sc_ps, PROC_LOGGER, -1, cmd, -1, iov, 2);
+ if (proc_composev_imsg(env->sc_ps, PROC_LOGGER, -1, cmd, -1, iov,
+ 2) != 0) {
+ log_warn("%s: failed to compose imsg", __func__);
+ return;
+ }
}
void