Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
815c378b
Unverified
Commit
815c378b
authored
Feb 26, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree-wide: replace old-style sysinfo logging return helper
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b1b38fd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
cgfsng.c
src/lxc/cgroups/cgfsng.c
+2
-2
log.h
src/lxc/log.h
+21
-7
No files found.
src/lxc/cgroups/cgfsng.c
View file @
815c378b
...
...
@@ -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
;
}
...
...
src/lxc/log.h
View file @
815c378b
...
...
@@ -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__); \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment