diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-20 18:39:06 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-20 18:39:06 +0000 |
commit | 14a96b44bbc9ff2303d0064ae9fff5188b1069f6 (patch) | |
tree | 810fea7a3c961f4433a26bd21db4e883da62ac14 /usr.sbin/bgpd/imsg.c | |
parent | 23dbfcd00d655ddaecabf492d0ab6691f6e7d72c (diff) |
fatal() is a bit too much on 0 bytes read. imsg_get returns 0 in other
cases as well and all receivers cope
Diffstat (limited to 'usr.sbin/bgpd/imsg.c')
-rw-r--r-- | usr.sbin/bgpd/imsg.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c index dc315dd277c..4a7bf9e13f4 100644 --- a/usr.sbin/bgpd/imsg.c +++ b/usr.sbin/bgpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.2 2003/12/20 14:33:09 henning Exp $ */ +/* $OpenBSD: imsg.c,v 1.3 2003/12/20 18:39:05 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -76,8 +76,10 @@ get_imsg(int fd, struct imsg *imsg) } } } while (n > 0); - if (read_total == 0) /* connection closed ? */ - fatal("pipe closed", 0); + + if (read_total == 0) /* connection closed */ + return (0); + return (datalen + IMSG_HEADER_SIZE); } |