X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fensc_wrappers%2Fwrappers_handler.hc;h=b89baf786dd81c5fd171997e83db41d23a9e4e64;hb=1ca5479415a0407ef7f8e059ab4f5f36a8238e30;hp=7f7ca442a443d105f968af2810f79403aa8d737f;hpb=c66b2f97361761b8a87058dc7a49ab59d4520556;p=util-vserver.git diff --git a/util-vserver/ensc_wrappers/wrappers_handler.hc b/util-vserver/ensc_wrappers/wrappers_handler.hc index 7f7ca44..b89baf7 100644 --- a/util-vserver/ensc_wrappers/wrappers_handler.hc +++ b/util-vserver/ensc_wrappers/wrappers_handler.hc @@ -24,13 +24,26 @@ #include #include -static UNUSED void -FatalErrnoError(bool condition, char const msg[]) /*@*/ +static inline ALWAYSINLINE NORETURN void +FatalErrnoErrorFail(char const msg[]) { extern int wrapper_exit_code; - if (!condition) return; +#ifdef ENSC_WRAPPERS_PREFIX + { + int old_errno = errno; + WRITE_MSG(2, ENSC_WRAPPERS_PREFIX); + errno = old_errno; + } +#endif perror(msg); - + exit(wrapper_exit_code); } + +static UNUSED void +FatalErrnoError(bool condition, char const msg[]) /*@*/ +{ + if (__builtin_expect(!condition,true)) return; + FatalErrnoErrorFail(msg); +}