Earlier version silently failed without logging anything.
$ logger --journald=/etc/services ; echo $?
1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
*/
#include <errno.h>
+#include <limits.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
}
if (lines == vectors) {
vectors *= 2;
+ if (IOV_MAX < vectors)
+ errx(EXIT_FAILURE, _("maximum input lines (%d) exceeded"), IOV_MAX);
iovec = xrealloc(iovec, vectors * sizeof(struct iovec));
}
iovec[lines].iov_base = buf;
int ret = journald_entry(jfd);
if (stdin != jfd)
fclose(jfd);
- return ret ? EXIT_FAILURE : EXIT_SUCCESS;
+ if (ret)
+ errx(EXIT_FAILURE, "journald entry could not be wrote");
+ return EXIT_SUCCESS;
}
#endif
if (server)