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
23253ca0
Unverified
Commit
23253ca0
authored
Jun 26, 2018
by
2xsec
Committed by
Christian Brauner
Jun 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: change DEBUG, INFO, TRACE, NOTICE macro using strerror to SYS* macro
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
2631ae67
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
34 deletions
+28
-34
lxc_init.c
src/lxc/cmd/lxc_init.c
+5
-9
lxc_monitord.c
src/lxc/cmd/lxc_monitord.c
+1
-1
commands.c
src/lxc/commands.c
+2
-2
conf.c
src/lxc/conf.c
+6
-9
initutils.c
src/lxc/initutils.c
+2
-1
overlay.c
src/lxc/storage/overlay.c
+3
-3
storage_utils.c
src/lxc/storage/storage_utils.c
+1
-1
terminal.c
src/lxc/terminal.c
+6
-7
utils.c
src/lxc/utils.c
+2
-1
No files found.
src/lxc/cmd/lxc_init.c
View file @
23253ca0
...
...
@@ -335,9 +335,8 @@ int main(int argc, char *argv[])
sigerr
=
signal
(
i
,
SIG_DFL
);
if
(
sigerr
==
SIG_ERR
)
{
DEBUG
(
"%s - Failed to reset to default action "
"for signal
\"
%d
\"
: %d"
,
strerror
(
errno
),
i
,
pid
);
SYSDEBUG
(
"Failed to reset to default action "
"for signal
\"
%d
\"
: %d"
,
i
,
pid
);
}
}
...
...
@@ -409,8 +408,7 @@ int main(int argc, char *argv[])
}
else
{
ret
=
kill
(
-
1
,
SIGTERM
);
if
(
ret
<
0
)
DEBUG
(
"%s - Failed to send SIGTERM to "
"all children"
,
strerror
(
errno
));
SYSDEBUG
(
"Failed to send SIGTERM to all children"
);
}
alarm
(
1
);
}
...
...
@@ -424,16 +422,14 @@ int main(int argc, char *argv[])
}
else
{
ret
=
kill
(
-
1
,
SIGKILL
);
if
(
ret
<
0
)
DEBUG
(
"%s - Failed to send SIGTERM to "
"all children"
,
strerror
(
errno
));
SYSDEBUG
(
"Failed to send SIGTERM to all children"
);
}
break
;
}
default:
ret
=
kill
(
pid
,
was_interrupted
);
if
(
ret
<
0
)
DEBUG
(
"%s - Failed to send signal
\"
%d
\"
to "
"%d"
,
strerror
(
errno
),
was_interrupted
,
pid
);
SYSDEBUG
(
"Failed to send signal
\"
%d
\"
to %d"
,
was_interrupted
,
pid
);
break
;
}
ret
=
EXIT_SUCCESS
;
...
...
src/lxc/cmd/lxc_monitord.c
View file @
23253ca0
...
...
@@ -91,7 +91,7 @@ static int lxc_monitord_fifo_create(struct lxc_monitor *mon)
ret
=
mknod
(
fifo_path
,
S_IFIFO
|
S_IRUSR
|
S_IWUSR
,
0
);
if
(
ret
<
0
&&
errno
!=
EEXIST
)
{
INFO
(
"Failed to mknod monitor fifo %s: %s."
,
fifo_path
,
strerror
(
errno
)
);
SYSINFO
(
"Failed to mknod monitor fifo %s"
,
fifo_path
);
return
-
1
;
}
...
...
src/lxc/commands.c
View file @
23253ca0
...
...
@@ -307,8 +307,8 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
client_fd
=
lxc_cmd_send
(
name
,
cmd
,
lxcpath
,
hashed_sock_name
);
if
(
client_fd
<
0
)
{
TRACE
(
"%s -
Command
\"
%s
\"
failed to connect command socket"
,
strerror
(
errno
),
lxc_cmd_str
(
cmd
->
req
.
cmd
));
SYSTRACE
(
"
Command
\"
%s
\"
failed to connect command socket"
,
lxc_cmd_str
(
cmd
->
req
.
cmd
));
if
(
client_fd
==
-
ECONNREFUSED
)
*
stopped
=
1
;
...
...
src/lxc/conf.c
View file @
23253ca0
...
...
@@ -1942,9 +1942,8 @@ static int mount_entry(const char *fsname, const char *target,
rootfs
);
if
(
ret
<
0
)
{
if
(
optional
)
{
INFO
(
"%s - Failed to mount
\"
%s
\"
on
\"
%s
\"
"
"(optional)"
,
strerror
(
errno
),
srcpath
?
srcpath
:
"(null)"
,
target
);
SYSINFO
(
"Failed to mount
\"
%s
\"
on
\"
%s
\"
(optional)"
,
srcpath
?
srcpath
:
"(null)"
,
target
);
return
0
;
}
...
...
@@ -2000,10 +1999,8 @@ static int mount_entry(const char *fsname, const char *target,
ret
=
mount
(
srcpath
,
target
,
fstype
,
mountflags
|
MS_REMOUNT
,
data
);
if
(
ret
<
0
)
{
if
(
optional
)
{
INFO
(
"Failed to mount
\"
%s
\"
on
\"
%s
\"
"
"(optional): %s"
,
srcpath
?
srcpath
:
"(null)"
,
target
,
strerror
(
errno
));
SYSINFO
(
"Failed to mount
\"
%s
\"
on
\"
%s
\"
(optional)"
,
srcpath
?
srcpath
:
"(null)"
,
target
);
return
0
;
}
...
...
@@ -2017,8 +2014,8 @@ static int mount_entry(const char *fsname, const char *target,
ret
=
mount
(
NULL
,
target
,
NULL
,
pflags
,
NULL
);
if
(
ret
<
0
)
{
if
(
optional
)
{
INFO
(
"%s -
Failed to change mount propagation "
"for
\"
%s
\"
(optional)"
,
strerror
(
errno
)
,
target
);
SYSINFO
(
"
Failed to change mount propagation "
"for
\"
%s
\"
(optional)"
,
target
);
return
0
;
}
else
{
SYSERROR
(
"Failed to change mount propagation "
...
...
src/lxc/initutils.c
View file @
23253ca0
...
...
@@ -21,6 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include <sys/prctl.h>
#include "initutils.h"
...
...
@@ -364,7 +365,7 @@ int setproctitle(char *title)
if
(
ret
==
0
)
(
void
)
strlcpy
((
char
*
)
arg_start
,
title
,
len
);
else
INFO
(
"setting cmdline failed - %s"
,
strerror
(
errno
)
);
SYSINFO
(
"setting cmdline failed"
);
return
ret
;
}
src/lxc/storage/overlay.c
View file @
23253ca0
...
...
@@ -636,9 +636,9 @@ int ovl_mount(struct lxc_storage *bdev)
ret
=
ovl_remount_on_enodev
(
lower
,
bdev
->
dest
,
ovl_name
,
MS_MGC_VAL
|
mntflags
,
options_work
);
if
(
ret
<
0
)
{
INFO
(
"Failed to mount
\"
%s
\"
on
\"
%s
\"
with options
\"
%s
\"
. "
"Retrying without workdir: %s
"
,
lower
,
bdev
->
dest
,
options_work
,
strerror
(
errno
)
);
SYS
INFO
(
"Failed to mount
\"
%s
\"
on
\"
%s
\"
with options
\"
%s
\"
. "
"Retrying without workdir
"
,
lower
,
bdev
->
dest
,
options_work
);
/* Assume we cannot use a workdir as we are on a version <= v21.
*/
...
...
src/lxc/storage/storage_utils.c
View file @
23253ca0
...
...
@@ -385,7 +385,7 @@ int find_fstype_cb(char *buffer, void *data)
}
if
(
mount
(
cbarg
->
rootfs
,
cbarg
->
target
,
fstype
,
mntflags
,
mntdata
))
{
DEBUG
(
"mount failed with error: %s"
,
strerror
(
errno
)
);
SYSDEBUG
(
"mount failed with error"
);
free
(
mntdata
);
return
0
;
}
...
...
src/lxc/terminal.c
View file @
23253ca0
...
...
@@ -163,8 +163,7 @@ struct lxc_terminal_state *lxc_terminal_signal_init(int srcfd, int dstfd)
lxc_list_add_tail
(
&
lxc_ttys
,
&
ts
->
node
);
ret
=
sigaddset
(
&
mask
,
SIGWINCH
);
if
(
ret
<
0
)
NOTICE
(
"%s - Failed to add SIGWINCH to signal set"
,
strerror
(
errno
));
SYSNOTICE
(
"Failed to add SIGWINCH to signal set"
);
}
/* Exit the mainloop cleanly on SIGTERM. */
...
...
@@ -411,9 +410,10 @@ int lxc_terminal_io_cb(int fd, uint32_t events, void *data,
if
(
w
!=
r
)
WARN
(
"Short write on terminal r:%d != w:%d"
,
r
,
w
);
if
(
w_rbuf
<
0
)
TRACE
(
"%s - Failed to write %d bytes to terminal ringbuffer"
,
strerror
(
-
w_rbuf
),
r
);
if
(
w_rbuf
<
0
)
{
errno
=
-
w_rbuf
;
SYSTRACE
(
"Failed to write %d bytes to terminal ringbuffer"
,
r
);
}
if
(
w_log
<
0
)
TRACE
(
"Failed to write %d bytes to terminal log"
,
r
);
...
...
@@ -681,8 +681,7 @@ static int lxc_terminal_peer_default(struct lxc_terminal *terminal)
if
(
terminal
->
peer
<
0
)
{
if
(
!
terminal
->
path
)
{
errno
=
ENODEV
;
DEBUG
(
"%s - The process does not have a controlling "
"terminal"
,
strerror
(
errno
));
SYSDEBUG
(
"The process does not have a controlling terminal"
);
goto
on_succes
;
}
...
...
src/lxc/utils.c
View file @
23253ca0
...
...
@@ -1080,7 +1080,8 @@ int randseed(bool srand_it)
if
(
f
)
{
int
ret
=
fread
(
&
seed
,
sizeof
(
seed
),
1
,
f
);
if
(
ret
!=
1
)
DEBUG
(
"unable to fread /dev/urandom, %s, fallback to time+pid rand seed"
,
strerror
(
errno
));
SYSDEBUG
(
"unable to fread /dev/urandom, fallback to time+pid rand seed"
);
fclose
(
f
);
}
...
...
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