getRecentName(): use realpath(3) instead of errorprone 'chdir()' calls
[util-vserver.git] / util-vserver / lib / getvserverctx.c
index 71de198..5334a5c 100644 (file)
@@ -45,7 +45,7 @@ getCtxFromFile(char const *pathname)
       (lseek(fd, 0, SEEK_SET)==-1))
     return VC_NOCTX;
 
-  BS;
+  {
   char         buf[len+1];
   char         *errptr;
   xid_t                res;
@@ -57,14 +57,14 @@ getCtxFromFile(char const *pathname)
   if (*errptr!='\0' && *errptr!='\n') return VC_NOCTX;
 
   return res;
-  BE;
+  }
 }
 
 xid_t
 vc_getVserverCtx(char const *id, vcCfgStyle style, bool honor_static, bool *is_running)
 {
   size_t               l1 = strlen(id);
-  char                 buf[sizeof(CONFDIR "//") + l1 + sizeof("/run")];
+  char                 buf[sizeof(CONFDIR "//") + l1 + sizeof("/context")];
                            
   if (style==vcCFG_NONE || style==vcCFG_AUTO)
     style = vc_getVserverCfgStyle(id);