fixed some 'noreturn' warnings for the execv() functions
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 17 Feb 2004 02:32:39 +0000 (02:32 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 17 Feb 2004 02:32:39 +0000 (02:32 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@909 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/ensc_wrappers/wrappers-unistd.hc
util-vserver/ensc_wrappers/wrappers_handler.hc

index 5d7213a..7e0e3de 100644 (file)
@@ -46,13 +46,15 @@ Echroot(char const path[])
 inline static WRAPPER_DECL NORETURN void
 Eexecv(char const *path, char *argv[])
 {
-  FatalErrnoError(execv(path,argv)==-1, "execv()");
+  execv(path,argv);
+  FatalErrnoErrorFail("execv()");
 }
 
 inline static WRAPPER_DECL NORETURN void
 Eexecvp(char const *path, char *argv[])
 {
-  FatalErrnoError(execvp(path,argv)==-1, "execvp()");
+  execvp(path,argv);
+  FatalErrnoErrorFail("execvp()");
 }
 
 inline static WRAPPER_DECL void
index 7f7ca44..663b2d0 100644 (file)
 #include <stdbool.h>
 #include <stdio.h>
 
-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;
   perror(msg);
-
   exit(wrapper_exit_code);
 }
+
+static UNUSED void 
+FatalErrnoError(bool condition, char const msg[]) /*@*/
+{
+  if (!condition)       return;
+  FatalErrnoErrorFail(msg);
+}