mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-14 23:05:03 -04:00
Allow compilation on machines that do not have setrlimit.
This commit is contained in:
parent
f7af1941b8
commit
1c4288f492
@ -206,6 +206,7 @@ AC_CHECK_HEADERS([ \
|
|||||||
sys/mman.h \
|
sys/mman.h \
|
||||||
sys/param.h \
|
sys/param.h \
|
||||||
sys/queue.h \
|
sys/queue.h \
|
||||||
|
sys/resource.h \
|
||||||
sys/select.h \
|
sys/select.h \
|
||||||
sys/sendfile.h \
|
sys/sendfile.h \
|
||||||
sys/socket.h \
|
sys/socket.h \
|
||||||
@ -336,6 +337,7 @@ AC_CHECK_FUNCS([ \
|
|||||||
putenv \
|
putenv \
|
||||||
sendfile \
|
sendfile \
|
||||||
setenv \
|
setenv \
|
||||||
|
setrlimit \
|
||||||
sigaction \
|
sigaction \
|
||||||
signal \
|
signal \
|
||||||
splice \
|
splice \
|
||||||
|
@ -24,12 +24,17 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "event2/event-config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
#ifdef _EVENT_HAVE_SYS_RESOURCE_H
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "event2/event-config.h"
|
|
||||||
#include "event2/event.h"
|
#include "event2/event.h"
|
||||||
#include "event2/bufferevent.h"
|
#include "event2/bufferevent.h"
|
||||||
#include "event2/listener.h"
|
#include "event2/listener.h"
|
||||||
@ -181,6 +186,7 @@ start_client(struct event_base *base)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
#if !defined(_WIN32) && defined(_EVENT_HAVE_SETRLIMIT)
|
||||||
/* Set the fd limit to a low value so that any fd leak is caught without
|
/* Set the fd limit to a low value so that any fd leak is caught without
|
||||||
making many requests. */
|
making many requests. */
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
@ -189,6 +195,7 @@ main(int argc, char **argv)
|
|||||||
perror("setrlimit");
|
perror("setrlimit");
|
||||||
exit(3);
|
exit(3);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set up an address, used by both client & server. */
|
/* Set up an address, used by both client & server. */
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user