tree-wide: replace old-style sysinfo logging return helper

parent b1b38fd1
......@@ -3063,7 +3063,7 @@ static bool unified_hierarchy_delegated(int dfd_base, char ***ret_files)
if (!faccessat(dfd_base, *s, W_OK, 0) || errno == ENOENT)
continue;
return sysinfo(false, "The %s file is not writable, skipping unified hierarchy", *s);
return sysinfo_ret(false, "The %s file is not writable, skipping unified hierarchy", *s);
}
*ret_files = move_ptr(list);
......@@ -3073,7 +3073,7 @@ static bool unified_hierarchy_delegated(int dfd_base, char ***ret_files)
static bool legacy_hierarchy_delegated(int dfd_base)
{
if (faccessat(dfd_base, "cgroup.procs", W_OK, 0) && errno != ENOENT)
return sysinfo(false, "The cgroup.procs file is not writable, skipping legacy hierarchy");
return sysinfo_ret(false, "The cgroup.procs file is not writable, skipping legacy hierarchy");
return true;
}
......
......@@ -494,13 +494,6 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
__internal_ret__; \
})
#define sysinfo(__ret__, format, ...) \
({ \
typeof(__ret__) __internal_ret__ = (__ret__); \
SYSINFO(format, ##__VA_ARGS__); \
__internal_ret__; \
})
#define log_error(__ret__, format, ...) \
({ \
typeof(__ret__) __internal_ret__ = (__ret__); \
......@@ -611,6 +604,27 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
__internal_ret__; \
})
#define sysinfo(format, ...) \
({ \
SYSINFO(format, ##__VA_ARGS__); \
(-errno); \
})
#define sysinfo_set(__ret__, format, ...) \
({ \
typeof(__ret__) __internal_ret__ = (__ret__); \
errno = labs(__ret__); \
SYSINFO(format, ##__VA_ARGS__); \
__internal_ret__; \
})
#define sysinfo_ret(__ret__, format, ...) \
({ \
typeof(__ret__) __internal_ret__ = (__ret__); \
SYSINFO(format, ##__VA_ARGS__); \
__internal_ret__; \
})
#define sysdebug(format, ...) \
({ \
SYSDEBUG(format, ##__VA_ARGS__); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment