#define CONCAT_TWO_ARGS(BUF, LHS,RHS) \
size_t BUF ## l1 = strlen(LHS); \
size_t BUF ## l2 = strlen(RHS); \
- char BUF[BUF ## l1 + BUF ## l2 + 2]; \
+ char BUF[BUF##l1 + BUF##l2 + 2]; \
\
- memcpy(BUF, LHS, BUF ## l1 + 1); \
- if (BUF ## l2>0) { \
- memcpy(BUF+BUF ## l1, "/", BUF ## l1); \
- memcpy(BUF+BUF ## l1+1, RHS, BUF ## l2+1); \
+ memcpy(BUF, LHS, BUF##l1 + 1); \
+ if (BUF##l2 > 0) { \
+ BUF[ BUF##l1 ] = '/'; \
+ memcpy(BUF+ BUF##l1 + 1, RHS, BUF##l2 + 1); \
}
static inline int
static inline int
setIAttr2(char const *lhs, char const *rhs, int flags)
{
- struct stat st;
CONCAT_TWO_ARGS(buf, lhs, rhs);
- if (stat(buf, &st)==-1) return -1;
- return vc_set_iattr_compat(buf, st.st_dev, st.st_ino,
- 0, flags, VC_IMMUTABLE_ALL, 0);
+ return vc_set_iattr(buf, 0, flags, VC_IMMUTABLE_ALL);
}
static inline int
return -1;
for (;;) {
- char const *basedir = CONFDIR "/.defaults/run.rev";
-
- if (!utilvserver_isDirectory(basedir, true)) basedir = DEFAULT_PKGSTATEREVDIR;
- if (!utilvserver_isDirectory(basedir, true)) break;
-
- if (symlink2(basedir, "", id, "run.rev")==-1)
- return -1;
-
- break;
- }
-
- for (;;) {
char const *basedir = CONFDIR "/.defaults/run";
if (!utilvserver_isDirectory(basedir, true)) basedir = DEFAULT_PKGSTATEDIR;