- if (methods == EVMETHOD_AUTO)
- if (!enable_secure () && getenv ("LIBEV_METHODS"))
- methods = atoi (getenv ("LIBEV_METHODS"));
- else
- methods = EVMETHOD_ANY;
+ if (!(flags & EVFLAG_NOENV) && !enable_secure () && getenv ("LIBEV_FLAGS"))
+ flags = atoi (getenv ("LIBEV_FLAGS"));
+
+ if (!(flags & 0x0000ffff))
+ flags |= 0x0000ffff;