mirror of
https://github.com/troglobit/finit.git
synced 2026-10-10 16:52:39 +07:00
Fix printf format specifier and formatting issues in use of log fns
Almost all related to and (less likely) possible causes of issue #236. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
|
||||
/* Netlink plugin for IFUP/IFDN and GW events
|
||||
*
|
||||
* Copyright (C) 2009-2011 Mårten Wikström <marten.wikstrom@keystream.se>
|
||||
@@ -252,7 +253,7 @@ static int nl_parse(int sd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
_d("recv %lld bytes", len);
|
||||
_d("recv %zd bytes", len);
|
||||
l = (size_t)len;
|
||||
for (nh = (struct nlmsghdr *)nl_buf; NLMSG_OK(nh, l); nh = NLMSG_NEXT(nh, l)) {
|
||||
struct nlmsgerr *nle;
|
||||
|
||||
+1
-1
@@ -526,7 +526,7 @@ void cgroup_init(uev_ctx_t *ctx)
|
||||
|
||||
/* Move ourselves to init (best effort, otherwise run in 'root' group */
|
||||
if (fnwrite("1", FINIT_CGPATH "/init/cgroup.procs")) {
|
||||
_pe("Failed moving PID 1 to cgroup ", FINIT_CGPATH "/init");
|
||||
_pe("Failed moving PID 1 to cgroup %s", FINIT_CGPATH "/init");
|
||||
uev_io_stop(&cgw);
|
||||
iwatch_exit(&iw_cgroup);
|
||||
close(fd);
|
||||
|
||||
+3
-3
@@ -558,7 +558,7 @@ static int service_start(svc_t *svc)
|
||||
|
||||
for (i = 0; i < we.we_wordc; i++) {
|
||||
if (strlen(we.we_wordv[i]) >= sizeof(svc->args[i])) {
|
||||
logit(LOG_ERR, "%s: expanded arg. '%s' too long", we.we_wordv[i]);
|
||||
logit(LOG_ERR, "%s: expanded arg. '%s' too long", svc->cmd, we.we_wordv[i]);
|
||||
rc = WRDE_NOSPACE;
|
||||
goto nomem;
|
||||
}
|
||||
@@ -931,7 +931,7 @@ static void parse_env(svc_t *svc, char *env)
|
||||
return;
|
||||
|
||||
if (strlen(env) >= sizeof(svc->env)) {
|
||||
_e("%s: env file is too long (>%d chars)", svc->cmd, sizeof(svc->env));
|
||||
_e("%s: env file is too long (>%zu chars)", svc->cmd, sizeof(svc->env));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ static void parse_cgroup(svc_t *svc, char *cgroup)
|
||||
}
|
||||
|
||||
if (strlen(ptr) >= sizeof(svc->cgroup)) {
|
||||
_e("%s: cgroup settings too long (>%d chars)", svc->cmd, sizeof(svc->cgroup));
|
||||
_e("%s: cgroup settings too long (>%zu chars)", svc->cmd, sizeof(svc->cgroup));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user