summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypldap
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2015-12-15 15:37:58 +0000
committeraraujo <araujo@FreeBSD.org>2015-12-15 15:37:58 +0000
commit99a0984f8bab31482ce2826097face2119a304e6 (patch)
treec08c479a9aab50fa7c661ba2ee27a5d61a7fde40 /usr.sbin/ypldap
parentea700ce7e5ef9274d1af43a729dd33103b671b8f (diff)
downloadFreeBSD-src-99a0984f8bab31482ce2826097face2119a304e6.zip
FreeBSD-src-99a0984f8bab31482ce2826097face2119a304e6.tar.gz
EAGAIN handling for imsg_read.
Approved by: bapt (mentor) Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D4547
Diffstat (limited to 'usr.sbin/ypldap')
-rw-r--r--usr.sbin/ypldap/ldapclient.c8
-rw-r--r--usr.sbin/ypldap/ypldap.c2
-rw-r--r--usr.sbin/ypldap/ypldap_dns.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c
index 897ceb2..ff4abe3 100644
--- a/usr.sbin/ypldap/ldapclient.c
+++ b/usr.sbin/ypldap/ldapclient.c
@@ -172,7 +172,7 @@ client_dispatch_dns(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0)
shut = 1;
@@ -275,7 +275,7 @@ client_dispatch_parent(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0)
shut = 1;
@@ -377,8 +377,10 @@ ldapclient(int pipe_main2client[2])
bzero(&env, sizeof(env));
TAILQ_INIT(&env.sc_idms);
- if ((pw = getpwnam(YPLDAP_USER)) == NULL)
+ if ((pw = getpwnam(YPLDAP_USER)) == NULL) {
+ printf("ldapclient.c error\n");
fatal("getpwnam");
+ }
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1)
fatal("socketpair");
diff --git a/usr.sbin/ypldap/ypldap.c b/usr.sbin/ypldap/ypldap.c
index ad7209a..7762270 100644
--- a/usr.sbin/ypldap/ypldap.c
+++ b/usr.sbin/ypldap/ypldap.c
@@ -361,7 +361,7 @@ main_dispatch_client(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0)
shut = 1;
diff --git a/usr.sbin/ypldap/ypldap_dns.c b/usr.sbin/ypldap/ypldap_dns.c
index 84836f1..507253c 100644
--- a/usr.sbin/ypldap/ypldap_dns.c
+++ b/usr.sbin/ypldap/ypldap_dns.c
@@ -140,7 +140,7 @@ dns_dispatch_imsg(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1)
+ if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
fatal("imsg_read error");
if (n == 0)
shut = 1;
OpenPOWER on IntegriCloud