X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/1c33c678365888dfd0e9ba9271dc55d6093d490d..b8c10cda08d48348f422bb3d31f019584cf252c9:/ev.c diff --git a/ev.c b/ev.c index 7bed969..3e1e8b4 100644 --- a/ev.c +++ b/ev.c @@ -415,8 +415,10 @@ sighandler (int signum) if (!gotsig) { + int old_errno = errno; gotsig = 1; write (sigpipe [1], &signum, 1); + errno = old_errno; } } @@ -538,12 +540,16 @@ ev_version_minor (void) return EV_VERSION_MINOR; } -/* return true if we are running with elevated privileges and ignore env variables */ +/* return true if we are running with elevated privileges and should ignore env variables */ static int enable_secure () { +#ifdef WIN32 + return 0; +#else return getuid () != geteuid () || getgid () != getegid (); +#endif } int ev_init (int methods)