--- libev/ev.c 2007/11/04 00:24:16 1.54 +++ libev/ev.c 2007/11/04 00:39:24 1.55 @@ -132,7 +132,7 @@ int events; } ANPENDING; -#ifdef EV_MULTIPLICITY +#if EV_MULTIPLICITY struct ev_loop { @@ -544,7 +544,7 @@ return method; } -static void +inline int loop_init (EV_P_ int methods) { if (!method) @@ -603,16 +603,19 @@ return method; } -#ifdef EV_MULTIPLICITY +#if EV_MULTIPLICITY struct ev_loop * ev_loop_new (int methods) { struct ev_loop *loop = (struct ev_loop *)calloc (1, sizeof (struct ev_loop)); - loop_init (EV_A_ methods); + if (loop_init (EV_A_ methods)) + return loop; + + ev_loop_delete (loop); - return loop; + return 0; } void @@ -627,7 +630,7 @@ int ev_init (int methods) { - loop_init (); + return loop_init (methods); } #endif