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
b15eb500
Unverified
Commit
b15eb500
authored
Jun 19, 2020
by
Christian Brauner
Committed by
Stéphane Graber
Jun 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CODING_STYLE: adapt code example
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
1478a2fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
CODING_STYLE.md
CODING_STYLE.md
+6
-7
No files found.
CODING_STYLE.md
View file @
b15eb500
...
...
@@ -733,11 +733,11 @@ __do_closedir __attribute__((__cleanup__(__auto_closedir__)))
```
For example:
```
c
void
remount_all_slave
(void)
void
turn_into_dependent_mounts
(void)
{
__do_free char
*
line = NULL;
__do_fclose FILE
*
f = NULL;
__do_close
_prot_errno
int memfd = -EBADF, mntinfo_fd = -EBADF;
__do_close int memfd = -EBADF, mntinfo_fd = -EBADF;
int ret;
ssize_t copied;
size_t len = 0;
...
...
@@ -780,7 +780,7 @@ again:
return;
}
f = fdopen(memfd, "r");
f = fdopen(memfd, "r
e
");
if (!f) {
SYSERROR("Failed to open copy of \"/proc/self/mountinfo\" to mark all shared. Continuing");
return;
...
...
@@ -810,12 +810,11 @@ again:
null_endofword(target);
ret = mount(NULL, target, NULL, MS_SLAVE, NULL);
if (ret < 0) {
SYSERROR("Failed to make \"%s\" MS_SLAVE", target);
ERROR("Continuing...");
SYSERROR("Failed to recursively turn old root mount tree into dependent mount. Continuing...");
continue;
}
TRACE("Re
mounted \"%s\" as MS_SLAVE", target
);
TRACE("Re
cursively turned old root mount tree into dependent mount"
);
}
TRACE("
Remounted all mount table entries as MS_SLAVE
");
TRACE("
Turned all mount table entries into dependent mount
");
}
```
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