Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / deliver_completed.c
blobfea53aa256d0dfbb88a00974e7448f973165667c
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* deliver_completed 3
6 /* SUMMARY
7 /* recipient delivery completion
8 /* SYNOPSIS
9 /* #include <deliver_completed.h>
11 /* void deliver_completed(stream, offset)
12 /* VSTREAM *stream;
13 /* long offset;
14 /* DESCRIPTION
15 /* deliver_completed() crosses off the specified recipient from
16 /* an open queue file. A -1 offset means ignore the request -
17 /* this is used for delivery requests that are passed on from
18 /* one delivery agent to another.
19 /* DIAGNOSTICS
20 /* Fatal error: unable to update the queue file.
21 /* LICENSE
22 /* .ad
23 /* .fi
24 /* The Secure Mailer license must be distributed with this software.
25 /* AUTHOR(S)
26 /* Wietse Venema
27 /* IBM T.J. Watson Research
28 /* P.O. Box 704
29 /* Yorktown Heights, NY 10598, USA
30 /*--*/
32 /* System library. */
34 #include <sys_defs.h>
36 /* Utility library. */
38 #include <msg.h>
39 #include <vstream.h>
41 /* Global library. */
43 #include "record.h"
44 #include "rec_type.h"
45 #include "deliver_completed.h"
47 /* deliver_completed - handle per-recipient delivery completion */
49 void deliver_completed(VSTREAM *stream, long offset)
51 const char *myname = "deliver_completed";
53 if (offset == -1)
54 return;
56 if (offset <= 0)
57 msg_panic("%s: bad offset %ld", myname, offset);
59 if (rec_put_type(stream, REC_TYPE_DONE, offset) < 0
60 || vstream_fflush(stream))
61 msg_fatal("update queue file %s: %m", VSTREAM_PATH(stream));