more evfd fix

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@209 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
mheily 2010-02-10 04:17:51 +00:00
parent 2d104a3fe8
commit 0dccf87b47
2 changed files with 5 additions and 5 deletions

View File

@ -51,10 +51,12 @@ post_configure_hook() {
evfilt_timer="src/posix/timer.c"
fi
if [ "$have_sys_eventfd_h" != "yes" ] ; then
evfilt_user="" # TODO: "src/posix/user.c"
sources="$sources src/posix/eventfd.c"
else
sources="$sources src/linux/eventfd.c"
fi
fi
sources="$sources src/$target/kevent.c src/$target/eventfd.c $evfilt_signal $evfilt_proc
sources="$sources src/$target/kevent.c $evfilt_signal $evfilt_proc
$evfilt_socket $evfilt_timer $evfilt_user $evfilt_vnode"
}

View File

@ -31,13 +31,12 @@ struct eventfd *
eventfd_create(void)
{
struct eventfd *e;
int evfd;
e = malloc(sizeof(*e));
if (e == NULL)
return (NULL);
if (socketpair(AF_UNIX, SOCK_STREAM, 0, e->fd) < 0)
if (socketpair(AF_UNIX, SOCK_STREAM, 0, e->fd) < 0) {
free(e);
return (NULL);
}
@ -46,7 +45,6 @@ eventfd_create(void)
free(e);
close(e->fd[0]);
close(e->fd[1]);
close(evfd);
return (NULL);
}