From eb8143d997a69e688c4349a47464c47837d3f53d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 3 May 2016 15:49:00 +0300 Subject: [PATCH] lib: Added o_stream_unix_write_fd() assert: fd>=0 --- src/lib/ostream-unix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/ostream-unix.c b/src/lib/ostream-unix.c index 9280c90ee9..e5d673ce53 100644 --- a/src/lib/ostream-unix.c +++ b/src/lib/ostream-unix.c @@ -83,6 +83,8 @@ bool o_stream_unix_write_fd(struct ostream *output, int fd) struct unix_ostream *ustream = (struct unix_ostream *)output->real_stream; + i_assert(fd >= 0); + if (ustream->write_fd >= 0) return FALSE; ustream->write_fd = fd;