updated
[util-vserver.git] / util-vserver / lib / getvserverctx.c
index 74225fd..774c80f 100644 (file)
 
 #include "vserver.h"
 #include "pathconfig.h"
+#include "compat-c99.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <string.h>
+#include <unistd.h>
 
-static ctx_t
+static xid_t
 getCtxFromFile(char const *pathname)
 {
   int          fd;
@@ -41,21 +44,23 @@ getCtxFromFile(char const *pathname)
       (len>50) ||
       (lseek(fd, 0, SEEK_SET)==-1))
     return VC_NOCTX;
+
+  BS;
+  char         buf[len+1];
+  char         *errptr;
+  xid_t                res;
   
-  char buf[len+1];
   if (TEMP_FAILURE_RETRY(read(fd, buf, len+1))!=len)
     return VC_NOCTX;
 
-  char         *errptr;
-  ctx_t                res;
-
   res = strtol(buf, &errptr, 10);
   if (*errptr!='\0' && *errptr!='\n') return VC_NOCTX;
 
   return res;
+  BE;
 }
 
-ctx_t
+xid_t
 vc_getVserverCtx(char const *id, vcCfgStyle style)
 {
   size_t               l1 = strlen(id);