diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2009-06-07 05:56:26 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2009-06-07 05:56:26 +0000 |
commit | 703b56a3f22756eac55e0bd7b17d1538de6c8000 (patch) | |
tree | 40f35f3c5bceaefa5fe710539018fdc22722309a /usr.sbin/smtpd/mta.c | |
parent | a09824e75d2192dc4f1a42afe21653e1f153c241 (diff) |
Change the way fds passed over a socket are retreived on the receiving side.
Currently the receiver fetches an imsg via imsg_get() and if he expects
an fd, he then calls imsg_get_fd() to fetch the next fd queued on the
imsgbuf from which the imsg came.
This changes hides the fd queueing mechanism to the API user. When closing
an imsg with an fd, the message is flagged so that the receiving end knows
it must dequeue the fd in imsg_get() and return it with the imsg structure.
This way there is no (less) possible screw up from imsg_get_fd() not being
called directly after imsg_get() by the user. The retreived imsg is
self-contained.
ok pyr@, "I like that" henning@
Diffstat (limited to 'usr.sbin/smtpd/mta.c')
-rw-r--r-- | usr.sbin/smtpd/mta.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index ac5e88fc6e6..6ce27978bed 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.59 2009/06/06 04:14:21 pyr Exp $ */ +/* $OpenBSD: mta.c,v 1.60 2009/06/07 05:56:25 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -307,9 +307,9 @@ mta_dispatch_queue(int sig, short event, void *p) IMSG_SIZE_CHECK(batchp); - if ((fd = imsg_get_fd(ibuf)) == -1) { + if ((fd = imsg.fd) == -1) { /* NEEDS_FIX - unsure yet how it must be handled */ - fatalx("mta_dispatch_queue: imsg_get_fd"); + fatalx("mta_dispatch_queue: imsg.fd == -1"); } batchp = batch_by_id(env, batchp->id); |