~ubuntu-branches/ubuntu/karmic/syslog-ng/karmic

« back to all changes in this revision

Viewing changes to src/fdread.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Hahler
  • Date: 2008-04-21 21:00:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080421210045-vvzvv1a6tkrlfek3
Tags: 2.0.9-1ubuntu1
* Sync from Debian, freeze exception granted in LP: #220031
* Fix build of syslog-ng.xml:
  - doc/reference/syslog-ng.xml:
    Fix reference to docbookx.dtd
  - debian/control:
    Build-Depend on docbook-xml
* doc/reference/README.syslog-ng-anon:
  Add missing last sample and link to sample config file; taken
  from http://dev.riseup.net/privacy/syslog-ng-anon/
* Modify Maintainer value to match the DebianMaintainerField
  specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "fdread.h"
25
25
#include "messages.h"
 
26
#include "alarms.h"
26
27
 
27
28
#include <errno.h>
28
29
 
36
37
      *sa = NULL;
37
38
      do
38
39
        {
 
40
          if (self->timeout)
 
41
            alarm_set(self->timeout);
39
42
          rc = read(self->fd, buf, buflen);
 
43
          
 
44
          if (self->timeout > 0 && rc == -1 && errno == EINTR && alarm_has_fired())
 
45
            {
 
46
              msg_notice("Nonblocking read has blocked, returning with an error",
 
47
                         evt_tag_int("fd", self->fd),
 
48
                         evt_tag_int("timeout", self->timeout),
 
49
                         NULL);
 
50
              alarm_cancel();
 
51
              break;
 
52
            }
 
53
          if (self->timeout)
 
54
            alarm_cancel();
40
55
        }
41
56
      while (rc == -1 && errno == EINTR);
42
57
    }