added workarounds for non-C99 compilers
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 26 Dec 2003 00:22:16 +0000 (00:22 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 26 Dec 2003 00:22:16 +0000 (00:22 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@475 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/getvserverbyctx.c
util-vserver/lib/getvserverctx.c

index 5c0be0a..6205e50 100644 (file)
@@ -23,6 +23,7 @@
 #include "vserver.h"
 #include "internal.h"
 #include "pathconfig.h"
+#include "compat-c99.h"
 
 #include <string.h>
 #include <unistd.h>
@@ -32,6 +33,7 @@ vc_getVserverByCtx(ctx_t ctx, vcCfgStyle *style, char const *revdir)
 {
   if (revdir==0) revdir = DEFAULT_PKGSTATEREVDIR;
 
+  BS;
   vcCfgStyle   cur_style = vcCFG_NONE;
   size_t       l = strlen(revdir);
   size_t       l1;
@@ -61,4 +63,5 @@ vc_getVserverByCtx(ctx_t ctx, vcCfgStyle *style, char const *revdir)
     default            :
       return 0;
   }
+  BE;
 }
index b963a02..3052c7a 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "vserver.h"
 #include "pathconfig.h"
+#include "compat-c99.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -43,18 +44,20 @@ getCtxFromFile(char const *pathname)
       (len>50) ||
       (lseek(fd, 0, SEEK_SET)==-1))
     return VC_NOCTX;
-  
-  char buf[len+1];
-  if (TEMP_FAILURE_RETRY(read(fd, buf, len+1))!=len)
-    return VC_NOCTX;
 
+  BS;
+  char         buf[len+1];
   char         *errptr;
   ctx_t                res;
+  
+  if (TEMP_FAILURE_RETRY(read(fd, buf, len+1))!=len)
+    return VC_NOCTX;
 
   res = strtol(buf, &errptr, 10);
   if (*errptr!='\0' && *errptr!='\n') return VC_NOCTX;
 
   return res;
+  BE;
 }
 
 ctx_t