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
fea3b91d
Unverified
Commit
fea3b91d
authored
Jun 05, 2018
by
Donghwa Jeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: change some logs to print errno
Signed-off-by:
Donghwa Jeong
<
dh48.jeong@samsung.com
>
parent
2095b6d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
conf.c
src/lxc/conf.c
+8
-6
No files found.
src/lxc/conf.c
View file @
fea3b91d
...
@@ -3186,26 +3186,28 @@ void remount_all_slave(void)
...
@@ -3186,26 +3186,28 @@ void remount_all_slave(void)
char
*
line
=
NULL
;
char
*
line
=
NULL
;
mntinfo_fd
=
open
(
"/proc/self/mountinfo"
,
O_RDONLY
|
O_CLOEXEC
);
mntinfo_fd
=
open
(
"/proc/self/mountinfo"
,
O_RDONLY
|
O_CLOEXEC
);
if
(
mntinfo_fd
<
0
)
if
(
mntinfo_fd
<
0
)
{
SYSERROR
(
"Failed to open
\"
/proc/self/mountinfo
\"
"
);
return
;
return
;
}
memfd
=
memfd_create
(
".lxc_mountinfo"
,
MFD_CLOEXEC
);
memfd
=
memfd_create
(
".lxc_mountinfo"
,
MFD_CLOEXEC
);
if
(
memfd
<
0
)
{
if
(
memfd
<
0
)
{
char
template
[]
=
P_tmpdir
"/.lxc_mountinfo_XXXXXX"
;
char
template
[]
=
P_tmpdir
"/.lxc_mountinfo_XXXXXX"
;
if
(
errno
!=
ENOSYS
)
{
if
(
errno
!=
ENOSYS
)
{
SYSERROR
(
"Failed to create temporary in-memory file"
);
close
(
mntinfo_fd
);
close
(
mntinfo_fd
);
WARN
(
"Failed to create temporary in-memory file"
);
return
;
return
;
}
}
memfd
=
lxc_make_tmpfile
(
template
,
true
);
memfd
=
lxc_make_tmpfile
(
template
,
true
);
}
if
(
memfd
<
0
)
{
if
(
memfd
<
0
)
{
close
(
mntinfo_fd
);
close
(
mntinfo_fd
);
WARN
(
"Failed to create temporary file"
);
WARN
(
"Failed to create temporary file"
);
return
;
return
;
}
}
}
#define __LXC_SENDFILE_MAX 0x7ffff000
/* maximum number of bytes sendfile can handle */
#define __LXC_SENDFILE_MAX 0x7ffff000
/* maximum number of bytes sendfile can handle */
again:
again:
...
@@ -3214,9 +3216,9 @@ again:
...
@@ -3214,9 +3216,9 @@ again:
if
(
errno
==
EINTR
)
if
(
errno
==
EINTR
)
goto
again
;
goto
again
;
SYSERROR
(
"Failed to copy
\"
/proc/self/mountinfo
\"
"
);
close
(
mntinfo_fd
);
close
(
mntinfo_fd
);
close
(
memfd
);
close
(
memfd
);
WARN
(
"Failed to copy
\"
/proc/self/mountinfo
\"
"
);
return
;
return
;
}
}
close
(
mntinfo_fd
);
close
(
mntinfo_fd
);
...
@@ -3226,14 +3228,14 @@ again:
...
@@ -3226,14 +3228,14 @@ again:
*/
*/
ret
=
lseek
(
memfd
,
0
,
SEEK_SET
);
ret
=
lseek
(
memfd
,
0
,
SEEK_SET
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to reset file descriptor offset"
);
close
(
memfd
);
close
(
memfd
);
WARN
(
"%s - Failed to reset file descriptor offset"
,
strerror
(
errno
));
return
;
return
;
}
}
f
=
fdopen
(
memfd
,
"r"
);
f
=
fdopen
(
memfd
,
"r"
);
if
(
!
f
)
{
if
(
!
f
)
{
WARN
(
"Failed to open copy of
\"
/proc/self/mountinfo
\"
to mark "
SYSERROR
(
"Failed to open copy of
\"
/proc/self/mountinfo
\"
to mark "
"all shared. Continuing"
);
"all shared. Continuing"
);
close
(
memfd
);
close
(
memfd
);
return
;
return
;
...
...
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