summaryrefslogtreecommitdiff
path: root/tests/netlink_protocol.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2018-12-30 15:35:21 +0000
committerDmitry V. Levin <ldv@altlinux.org>2018-12-30 15:35:21 +0000
commitd6c71dd0611e7e337edaf36c35ad51a90f404b14 (patch)
treef07993776311a1494d7dc339cf94d5a4c8dc5b82 /tests/netlink_protocol.c
parent51bd6db1ef017e44e878c62d4ea264f65106cb66 (diff)
downloadstrace-d6c71dd0611e7e337edaf36c35ad51a90f404b14.tar.gz
Fix preprocessor indentation
Indent the C preprocessor directives to reflect their nesting using the following script: $ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do cppi < "$f" > "$f".cppi; mv "$f".cppi "$f" done
Diffstat (limited to 'tests/netlink_protocol.c')
-rw-r--r--tests/netlink_protocol.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/netlink_protocol.c b/tests/netlink_protocol.c
index 30a0a0791..fd901d884 100644
--- a/tests/netlink_protocol.c
+++ b/tests/netlink_protocol.c
@@ -345,7 +345,7 @@ test_nlmsg_done(const int fd)
fd, nlh->nlmsg_len, num, nlh->nlmsg_len, sprintrc(rc));
}
-#if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
+# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
static void
test_ack_flags(const int fd)
{
@@ -355,34 +355,34 @@ test_ack_flags(const int fd)
.nlmsg_type = NLMSG_ERROR,
};
-#ifdef NLM_F_CAPPED
+# ifdef NLM_F_CAPPED
nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED,
rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0);
printf("sendto(%d, {len=%u, type=NLMSG_ERROR"
", flags=NLM_F_REQUEST|NLM_F_CAPPED, seq=0, pid=0}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc));
-#endif
+# endif
-#ifdef NLM_F_ACK_TLVS
+# ifdef NLM_F_ACK_TLVS
nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK_TLVS;
rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0);
printf("sendto(%d, {len=%u, type=NLMSG_ERROR"
", flags=NLM_F_REQUEST|NLM_F_ACK_TLVS, seq=0, pid=0}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc));
-#endif
+# endif
-#if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS
+# if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS
nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED | NLM_F_ACK_TLVS;
rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0);
printf("sendto(%d, {len=%u, type=NLMSG_ERROR"
", flags=NLM_F_REQUEST|NLM_F_CAPPED|NLM_F_ACK_TLVS, seq=0, pid=0}"
", %u, MSG_DONTWAIT, NULL, 0) = %s\n",
fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc));
-#endif
+# endif
}
-#endif
+# endif
int main(void)
{
@@ -399,9 +399,9 @@ int main(void)
send_query(fd);
test_nlmsgerr(fd);
test_nlmsg_done(fd);
-#if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
+# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS
test_ack_flags(fd);
-#endif
+# endif
puts("+++ exited with 0 +++");
return 0;