~ubuntu-branches/ubuntu/lucid/libevent/lucid

« back to all changes in this revision

Viewing changes to test/test-weof.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2009-05-15 20:11:06 UTC
  • mfrom: (1.3.1 upstream) (5.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090515201106-auauq7m2l4sej5n9
Tags: 1.4.11-stable-1
* New upstream release 
  - Fix a bug when removing a timeout from the heap
  - Remove the limit on size of HTTP headers by removing static buffers
  - Fix a nasty dangling pointer bug in epoll.c that could occur after
    epoll_recalc() 

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#endif
8
8
 
9
9
 
 
10
#ifdef WIN32
 
11
#include <winsock2.h>
 
12
#endif
10
13
#include <sys/types.h>
11
14
#include <sys/stat.h>
12
15
#include <sys/time.h>
 
16
#ifdef HAVE_SYS_SOCKET_H
13
17
#include <sys/socket.h>
 
18
#endif
14
19
#include <fcntl.h>
15
20
#include <stdlib.h>
16
21
#include <stdio.h>
20
25
#include <errno.h>
21
26
 
22
27
#include <event.h>
 
28
#include <evutil.h>
23
29
 
24
30
int pair[2];
25
31
int test_okay = 1;
26
32
int called = 0;
27
33
 
28
 
void
 
34
static void
29
35
write_cb(int fd, short event, void *arg)
30
36
{
31
 
        char *test = "test string";
 
37
        const char *test = "test string";
32
38
        int len;
33
39
 
34
40
        len = write(fd, test, strlen(test) + 1);
51
57
{
52
58
        struct event ev;
53
59
 
 
60
#ifndef WIN32
54
61
        if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
55
62
                return (1);
 
63
#endif
56
64
 
57
 
        if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
 
65
        if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
58
66
                return (1);
59
67
 
60
68
        /* Initalize the event library */