summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/rtnl-message.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-02-22 19:26:27 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-02-24 19:24:14 -0500
commitbdd13f6be4b588568683a1ab54f421fc6a636dbb (patch)
tree1a1f661d8e83011f53e9122f7dc61272dc16ddfa /src/libsystemd/sd-rtnl/rtnl-message.c
parente9a2e453bbe3522db4341e4a2a49ae8aab8eb5a3 (diff)
Remove dead lines in various places
As pointed-out by clang -Wunreachable-code. No behaviour changes.
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 8c20b8e765..dc74947993 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -480,7 +480,7 @@ int sd_rtnl_message_append_u16(sd_rtnl_message *m, unsigned short type, uint16_t
break;
else
return -ENOTSUP;
- break;
+
default:
return -ENOTSUP;
}
@@ -932,10 +932,6 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
if (k > 0)
switch (m->hdr->nlmsg_type) {
- struct ifinfomsg *ifi;
- struct ifaddrmsg *ifa;
- struct rtmsg *rtm;
-
/* check that the size matches the message type */
case NLMSG_ERROR:
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
@@ -948,6 +944,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg)))
k = -EIO;
else {
+ struct ifinfomsg *ifi;
+
ifi = NLMSG_DATA(m->hdr);
UPDATE_RTA(m, IFLA_RTA(ifi));
}
@@ -958,6 +956,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifaddrmsg)))
k = -EIO;
else {
+ struct ifaddrmsg *ifa;
+
ifa = NLMSG_DATA(m->hdr);
UPDATE_RTA(m, IFA_RTA(ifa));
}
@@ -968,6 +968,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtmsg)))
k = -EIO;
else {
+ struct rtmsg *rtm;
+
rtm = NLMSG_DATA(m->hdr);
UPDATE_RTA(m, RTM_RTA(rtm));
}