Util-Linux package development
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH] logger: shadow declaration
Date: Sat, 31 Oct 2015 12:27:36 +0000	[thread overview]
Message-ID: <1446294456-1846-1-git-send-email-kerolasa@iki.fi> (raw)

misc-utils/logger.c:448:17: warning: declaration of 'msg' shadows a
				parameter [-Wshadow]
misc-utils/logger.c:429:74: note: shadowed declaration is here

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 misc-utils/logger.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index eda160a..e439266 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -445,7 +445,7 @@ static void write_output(const struct logger_ctl *ctl, const char *const msg)
 	iovec_add_string(iov, iovlen, msg, 0);
 
 	if (!ctl->noact) {
-		struct msghdr msg = { 0 };
+		struct msghdr message = { 0 };
 		struct cmsghdr *cmhp;
 		struct ucred *cred;
 		union {
@@ -457,8 +457,8 @@ static void write_output(const struct logger_ctl *ctl, const char *const msg)
 		if ((ctl->socket_type == TYPE_TCP) && !ctl->octet_count)
 			iovec_add_string(iov, iovlen, "\n", 1);
 
-		msg.msg_iov = iov;
-		msg.msg_iovlen = iovlen;
+		message.msg_iov = iov;
+		message.msg_iovlen = iovlen;
 
 		/* syslog/journald may follow local socket credentials rather
 		 * than in the message PID. If we use --id as root than we can
@@ -468,10 +468,10 @@ static void write_output(const struct logger_ctl *ctl, const char *const msg)
 		if (ctl->pid && !ctl->server && ctl->pid != getpid()
 		    && geteuid() == 0 && kill(ctl->pid, 0) == 0) {
 
-			msg.msg_control = cbuf.control;
-			msg.msg_controllen = CMSG_SPACE(sizeof(struct ucred));
+			message.msg_control = cbuf.control;
+			message.msg_controllen = CMSG_SPACE(sizeof(struct ucred));
 
-			cmhp = CMSG_FIRSTHDR(&msg);
+			cmhp = CMSG_FIRSTHDR(&message);
 			cmhp->cmsg_len = CMSG_LEN(sizeof(struct ucred));
 			cmhp->cmsg_level = SOL_SOCKET;
 			cmhp->cmsg_type = SCM_CREDENTIALS;
@@ -480,7 +480,7 @@ static void write_output(const struct logger_ctl *ctl, const char *const msg)
 			cred->pid = ctl->pid;
 		}
 
-		if (sendmsg(ctl->fd, &msg, 0) < 0)
+		if (sendmsg(ctl->fd, &message, 0) < 0)
 			warn(_("send message failed"));
 	}
 
-- 
2.6.2


             reply	other threads:[~2015-10-31 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-31 12:27 Sami Kerola [this message]
2015-11-06 12:20 ` [PATCH] logger: shadow declaration Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446294456-1846-1-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox