~ubuntu-branches/ubuntu/vivid/postfix/vivid-proposed

« back to all changes in this revision

Viewing changes to src/global/timed_ipc.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-02-27 09:33:07 UTC
  • Revision ID: james.westby@ubuntu.com-20050227093307-cn789t27ibnlh6tf
Tags: upstream-2.1.5
ImportĀ upstreamĀ versionĀ 2.1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*++
 
2
/* NAME
 
3
/*      timed_ipc 3
 
4
/* SUMMARY
 
5
/*      enforce IPC timeout on stream
 
6
/* SYNOPSIS
 
7
/*      #include <time_ipc.h>
 
8
/*
 
9
/*      void    timed_ipc_setup(stream)
 
10
/*      VSTREAM *stream;
 
11
/* DESCRIPTION
 
12
/*      timed_ipc() enforces on the specified stream the timeout as
 
13
/*      specified via the \fIipc_timeout\fR configuration parameter:
 
14
/*      a read or write operation fails if it does not succeed within
 
15
/*      \fIipc_timeout\fR seconds. This deadline exists as a safety
 
16
/*      measure for communication between mail subsystem programs,
 
17
/*      and should never be exceeded.
 
18
/* DIAGNOSTICS
 
19
/*      Panic: sanity check failed. Fatal error: deadline exceeded.
 
20
/* LICENSE
 
21
/* .ad
 
22
/* .fi
 
23
/*      The Secure Mailer license must be distributed with this software.
 
24
/* AUTHOR(S)
 
25
/*      Wietse Venema
 
26
/*      IBM T.J. Watson Research
 
27
/*      P.O. Box 704
 
28
/*      Yorktown Heights, NY 10598, USA
 
29
/*--*/
 
30
 
 
31
/* System library. */
 
32
 
 
33
#include <sys_defs.h>
 
34
 
 
35
/* Utility library. */
 
36
 
 
37
#include <msg.h>
 
38
#include <vstream.h>
 
39
 
 
40
/* Global library. */
 
41
 
 
42
#include "mail_params.h"
 
43
#include "timed_ipc.h"
 
44
 
 
45
/* timed_ipc_setup - enable ipc with timeout */
 
46
 
 
47
void    timed_ipc_setup(VSTREAM *stream)
 
48
{
 
49
    if (var_ipc_timeout <= 0)
 
50
        msg_panic("timed_ipc_setup: bad ipc_timeout %d", var_ipc_timeout);
 
51
 
 
52
    vstream_control(stream,
 
53
                    VSTREAM_CTL_TIMEOUT, var_ipc_timeout,
 
54
                    VSTREAM_CTL_END);
 
55
}