[systemd-commits] 2 commits - src/core
Michal Schmidt
michich at kemper.freedesktop.org
Wed May 9 02:22:43 PDT 2012
src/core/main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit b809bd0940b3c12d49cfc79d2a2c1a449b3dcf50
Author: Michal Schmidt <mschmidt at redhat.com>
Date: Wed May 9 11:20:06 2012 +0200
main: fix uninitialized variable
diff --git a/src/core/main.c b/src/core/main.c
index be9d0a6..8c25819 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1185,7 +1185,7 @@ static int do_switch_root(const char *switch_root) {
}
if (chroot(".") < 0)
- log_warning("Failed to change root, ignoring: %s", strerror(-r));
+ log_warning("Failed to change root, ignoring: %m");
/* FIXME: remove old root */
commit e564a98237817d8c89f7979856a87d3788988742
Author: Michal Schmidt <mschmidt at redhat.com>
Date: Wed May 9 11:13:26 2012 +0200
main: fix assertion failure due to use of ELEMENTSOF on a non-array
diff --git a/src/core/main.c b/src/core/main.c
index d7ce8ab..be9d0a6 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1640,7 +1640,7 @@ finish:
if (reexecute) {
const char **args;
- unsigned i;
+ unsigned i, args_size;
/* Close and disarm the watchdog, so that the new
* instance can reinitialize it, but doesn't get
@@ -1650,7 +1650,8 @@ finish:
if (switch_root)
do_switch_root(switch_root);
- args = newa(const char*, MAX(5, argc+1));
+ args_size = MAX(5, argc+1);
+ args = newa(const char*, args_size);
if (!switch_root_init) {
char sfd[16];
@@ -1673,7 +1674,7 @@ finish:
args[i++] = sfd;
args[i++] = NULL;
- assert(i <= ELEMENTSOF(args));
+ assert(i <= args_size);
execv(args[0], (char* const*) args);
}
@@ -1695,7 +1696,7 @@ finish:
args[i++] = argv[j];
args[i++] = NULL;
- assert(i <= ELEMENTSOF(args));
+ assert(i <= args_size);
execv(args[0], (char* const*) args);
log_error("Failed to reexecute: %m");
More information about the systemd-commits
mailing list