EOF.
ok jmatthew@ claudio@
-/* $OpenBSD: ldapclient.c,v 1.28 2013/11/26 12:02:59 henning Exp $ */
+/* $OpenBSD: ldapclient.c,v 1.29 2014/07/13 12:07:59 krw Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
shut = 1;
break;
case EV_WRITE:
- if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+ if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
- imsg_event_add(iev);
- return;
+ if (n == 0)
+ shut = 1;
+ goto done;
default:
fatalx("unknown event");
}
imsg_compose_event(env->sc_iev, IMSG_END_UPDATE, 0, 0, -1,
NULL, 0);
+done:
if (!shut)
imsg_event_add(iev);
else {
shut = 1;
break;
case EV_WRITE:
- if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN)
+ if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
- imsg_event_add(iev);
- return;
+ if (n == 0)
+ shut = 1;
+ goto done;
default:
fatalx("unknown event");
}
}
imsg_free(&imsg);
}
+
+done:
if (!shut)
imsg_event_add(iev);
else {
-/* $OpenBSD: ypldap.c,v 1.12 2012/03/15 01:44:22 jmatthew Exp $ */
+/* $OpenBSD: ypldap.c,v 1.13 2014/07/13 12:07:59 krw Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
#include <arpa/inet.h>
#include <err.h>
+#include <errno.h>
#include <event.h>
#include <fcntl.h>
#include <unistd.h>
shut = 1;
break;
case EV_WRITE:
- if (msgbuf_write(&ibuf->w) == -1)
+ if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
- imsg_event_add(iev);
- return;
+ if (n == 0)
+ shut = 1;
+ goto done;
default:
fatalx("unknown event");
}
}
imsg_free(&imsg);
}
+
+done:
if (!shut)
imsg_event_add(iev);
else {
-/* $OpenBSD: ypldap_dns.c,v 1.5 2012/03/16 01:57:42 jmatthew Exp $ */
+/* $OpenBSD: ypldap_dns.c,v 1.6 2014/07/13 12:07:59 krw Exp $ */
/*
* Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org>
shut = 1;
break;
case EV_WRITE:
- if (msgbuf_write(&ibuf->w) == -1)
+ if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN)
fatal("msgbuf_write");
- imsg_event_add(iev);
- return;
+ if (n == 0)
+ shut = 1;
+ goto done;
default:
fatalx("unknown event");
}
}
imsg_free(&imsg);
}
+
+done:
if (!shut)
imsg_event_add(iev);
else {