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
2f3f7152
Unverified
Commit
2f3f7152
authored
Jun 26, 2017
by
0x0916
Committed by
Stéphane Graber
Jul 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the `__func__` macro
Our logging function will always spew out the function name. Signed-off-by:
0x0916
<
w@laoqinren.net
>
parent
48542305
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
lxcbtrfs.c
src/lxc/bdev/lxcbtrfs.c
+3
-3
cgfs.c
src/lxc/cgroups/cgfs.c
+5
-5
cgmanager.c
src/lxc/cgroups/cgmanager.c
+2
-2
conf.c
src/lxc/conf.c
+1
-1
utils.c
src/lxc/utils.c
+8
-8
No files found.
src/lxc/bdev/lxcbtrfs.c
View file @
2f3f7152
...
@@ -68,13 +68,13 @@ char *get_btrfs_subvol_path(int fd, u64 dir_id, u64 objid, char *name,
...
@@ -68,13 +68,13 @@ char *get_btrfs_subvol_path(int fd, u64 dir_id, u64 objid, char *name,
ret
=
ioctl
(
fd
,
BTRFS_IOC_INO_LOOKUP
,
&
args
);
ret
=
ioctl
(
fd
,
BTRFS_IOC_INO_LOOKUP
,
&
args
);
e
=
errno
;
e
=
errno
;
if
(
ret
)
{
if
(
ret
)
{
ERROR
(
"
%s: ERROR:
Failed to lookup path for %llu %llu %s - %s
\n
"
,
ERROR
(
"Failed to lookup path for %llu %llu %s - %s
\n
"
,
__func__
,
(
unsigned
long
long
)
dir_id
,
(
unsigned
long
long
)
dir_id
,
(
unsigned
long
long
)
objid
,
(
unsigned
long
long
)
objid
,
name
,
strerror
(
e
));
name
,
strerror
(
e
));
return
NULL
;
return
NULL
;
}
else
}
else
INFO
(
"
%s: got path for %llu %llu - %s
\n
"
,
__func__
,
INFO
(
"
Got path for %llu %llu - %s
\n
"
,
(
unsigned
long
long
)
objid
,
(
unsigned
long
long
)
dir_id
,
(
unsigned
long
long
)
objid
,
(
unsigned
long
long
)
dir_id
,
name
);
name
);
...
...
src/lxc/cgroups/cgfs.c
View file @
2f3f7152
...
@@ -165,7 +165,7 @@ static int cgroup_rmdir(char *dirname)
...
@@ -165,7 +165,7 @@ static int cgroup_rmdir(char *dirname)
dir
=
opendir
(
dirname
);
dir
=
opendir
(
dirname
);
if
(
!
dir
)
{
if
(
!
dir
)
{
ERROR
(
"
%s: failed to open %s"
,
__func__
,
dirname
);
ERROR
(
"
Failed to open %s"
,
dirname
);
return
-
1
;
return
-
1
;
}
}
...
@@ -190,7 +190,7 @@ static int cgroup_rmdir(char *dirname)
...
@@ -190,7 +190,7 @@ static int cgroup_rmdir(char *dirname)
}
}
ret
=
lstat
(
pathname
,
&
mystat
);
ret
=
lstat
(
pathname
,
&
mystat
);
if
(
ret
)
{
if
(
ret
)
{
SYSERROR
(
"
%s: failed to stat %s"
,
__func__
,
pathname
);
SYSERROR
(
"
Failed to stat %s"
,
pathname
);
failed
=
1
;
failed
=
1
;
if
(
!
saved_errno
)
if
(
!
saved_errno
)
saved_errno
=
errno
;
saved_errno
=
errno
;
...
@@ -206,7 +206,7 @@ static int cgroup_rmdir(char *dirname)
...
@@ -206,7 +206,7 @@ static int cgroup_rmdir(char *dirname)
}
}
if
(
rmdir
(
dirname
)
<
0
)
{
if
(
rmdir
(
dirname
)
<
0
)
{
SYSERROR
(
"
%s: failed to delete %s"
,
__func__
,
dirname
);
SYSERROR
(
"
Failed to delete %s"
,
dirname
);
if
(
!
saved_errno
)
if
(
!
saved_errno
)
saved_errno
=
errno
;
saved_errno
=
errno
;
failed
=
1
;
failed
=
1
;
...
@@ -214,7 +214,7 @@ static int cgroup_rmdir(char *dirname)
...
@@ -214,7 +214,7 @@ static int cgroup_rmdir(char *dirname)
ret
=
closedir
(
dir
);
ret
=
closedir
(
dir
);
if
(
ret
)
{
if
(
ret
)
{
SYSERROR
(
"
%s: failed to close directory %s"
,
__func__
,
dirname
);
SYSERROR
(
"
Failed to close directory %s"
,
dirname
);
if
(
!
saved_errno
)
if
(
!
saved_errno
)
saved_errno
=
errno
;
saved_errno
=
errno
;
failed
=
1
;
failed
=
1
;
...
@@ -2229,7 +2229,7 @@ static int cgroup_read_from_file(const char *fn, char buf[], size_t bufsize)
...
@@ -2229,7 +2229,7 @@ static int cgroup_read_from_file(const char *fn, char buf[], size_t bufsize)
return
ret
;
return
ret
;
}
}
/* Callers don't do this, but regression/sanity check */
/* Callers don't do this, but regression/sanity check */
ERROR
(
"
%s: was not expecting 0 bufsize"
,
__func__
);
ERROR
(
"
was not expecting 0 bufsize"
);
return
-
1
;
return
-
1
;
}
}
buf
[
ret
]
=
'\0'
;
buf
[
ret
]
=
'\0'
;
...
...
src/lxc/cgroups/cgmanager.c
View file @
2f3f7152
...
@@ -395,7 +395,7 @@ static int do_chown_cgroup(const char *controller, const char *cgroup_path,
...
@@ -395,7 +395,7 @@ static int do_chown_cgroup(const char *controller, const char *cgroup_path,
goto
out
;
goto
out
;
}
}
if
(
send_creds
(
sv
[
0
],
getpid
(),
getuid
(),
getgid
()))
{
if
(
send_creds
(
sv
[
0
],
getpid
(),
getuid
(),
getgid
()))
{
SYSERROR
(
"
%s: Error sending pid over SCM_CREDENTIAL"
,
__func__
);
SYSERROR
(
"
Error sending pid over SCM_CREDENTIAL"
);
goto
out
;
goto
out
;
}
}
fds
.
fd
=
sv
[
0
];
fds
.
fd
=
sv
[
0
];
...
@@ -410,7 +410,7 @@ static int do_chown_cgroup(const char *controller, const char *cgroup_path,
...
@@ -410,7 +410,7 @@ static int do_chown_cgroup(const char *controller, const char *cgroup_path,
goto
out
;
goto
out
;
}
}
if
(
send_creds
(
sv
[
0
],
getpid
(),
newuid
,
0
))
{
if
(
send_creds
(
sv
[
0
],
getpid
(),
newuid
,
0
))
{
SYSERROR
(
"
%s: Error sending pid over SCM_CREDENTIAL"
,
__func__
);
SYSERROR
(
"
Error sending pid over SCM_CREDENTIAL"
);
goto
out
;
goto
out
;
}
}
fds
.
fd
=
sv
[
0
];
fds
.
fd
=
sv
[
0
];
...
...
src/lxc/conf.c
View file @
2f3f7152
...
@@ -3686,7 +3686,7 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
...
@@ -3686,7 +3686,7 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
if
(
rootuid
==
hostuid
)
{
if
(
rootuid
==
hostuid
)
{
// nothing to do
// nothing to do
INFO
(
"
%s: container root is our uid; no need to chown"
,
__func__
);
INFO
(
"
Container root is our uid; no need to chown"
);
return
0
;
return
0
;
}
}
...
...
src/lxc/utils.c
View file @
2f3f7152
...
@@ -99,7 +99,7 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
...
@@ -99,7 +99,7 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
dir
=
opendir
(
dirname
);
dir
=
opendir
(
dirname
);
if
(
!
dir
)
{
if
(
!
dir
)
{
ERROR
(
"
%s: failed to open %s"
,
__func__
,
dirname
);
ERROR
(
"
failed to open %s"
,
dirname
);
return
-
1
;
return
-
1
;
}
}
...
@@ -132,10 +132,10 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
...
@@ -132,10 +132,10 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
case
ENOTDIR
:
case
ENOTDIR
:
ret
=
unlink
(
pathname
);
ret
=
unlink
(
pathname
);
if
(
ret
)
if
(
ret
)
INFO
(
"
%s: failed to remove %s"
,
__func__
,
pathname
);
INFO
(
"
Failed to remove %s"
,
pathname
);
break
;
break
;
default:
default:
SYSERROR
(
"
%s: failed to rmdir %s"
,
__func__
,
pathname
);
SYSERROR
(
"
Failed to rmdir %s"
,
pathname
);
failed
=
1
;
failed
=
1
;
break
;
break
;
}
}
...
@@ -145,7 +145,7 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
...
@@ -145,7 +145,7 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
ret
=
lstat
(
pathname
,
&
mystat
);
ret
=
lstat
(
pathname
,
&
mystat
);
if
(
ret
)
{
if
(
ret
)
{
ERROR
(
"
%s: failed to stat %s"
,
__func__
,
pathname
);
ERROR
(
"
Failed to stat %s"
,
pathname
);
failed
=
1
;
failed
=
1
;
continue
;
continue
;
}
}
...
@@ -161,20 +161,20 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
...
@@ -161,20 +161,20 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
failed
=
1
;
failed
=
1
;
}
else
{
}
else
{
if
(
unlink
(
pathname
)
<
0
)
{
if
(
unlink
(
pathname
)
<
0
)
{
SYSERROR
(
"
%s: failed to delete %s"
,
__func__
,
pathname
);
SYSERROR
(
"
Failed to delete %s"
,
pathname
);
failed
=
1
;
failed
=
1
;
}
}
}
}
}
}
if
(
rmdir
(
dirname
)
<
0
&&
!
btrfs_try_remove_subvol
(
dirname
)
&&
!
hadexclude
)
{
if
(
rmdir
(
dirname
)
<
0
&&
!
btrfs_try_remove_subvol
(
dirname
)
&&
!
hadexclude
)
{
ERROR
(
"
%s: failed to delete %s"
,
__func__
,
dirname
);
ERROR
(
"
Failed to delete %s"
,
dirname
);
failed
=
1
;
failed
=
1
;
}
}
ret
=
closedir
(
dir
);
ret
=
closedir
(
dir
);
if
(
ret
)
{
if
(
ret
)
{
ERROR
(
"
%s: failed to close directory %s"
,
__func__
,
dirname
);
ERROR
(
"
Failed to close directory %s"
,
dirname
);
failed
=
1
;
failed
=
1
;
}
}
...
@@ -213,7 +213,7 @@ extern int lxc_rmdir_onedev(char *path, const char *exclude)
...
@@ -213,7 +213,7 @@ extern int lxc_rmdir_onedev(char *path, const char *exclude)
if
(
lstat
(
path
,
&
mystat
)
<
0
)
{
if
(
lstat
(
path
,
&
mystat
)
<
0
)
{
if
(
errno
==
ENOENT
)
if
(
errno
==
ENOENT
)
return
0
;
return
0
;
ERROR
(
"
%s: failed to stat %s"
,
__func__
,
path
);
ERROR
(
"
Failed to stat %s"
,
path
);
return
-
1
;
return
-
1
;
}
}
...
...
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