#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;
(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);