[lxc-devel] [lxc/master] cmd: Fix format issues found by clang-format
tcharding on Github
lxc-bot at linuxcontainers.org
Mon Aug 20 23:59:28 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 544 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180820/f6af2b0c/attachment.bin>
-------------- next part --------------
From 2ec1c4845378cce7184072be9bbc072606e861ca Mon Sep 17 00:00:00 2001
From: "Tobin C. Harding" <me at tobin.cc>
Date: Tue, 21 Aug 2018 09:44:36 +1000
Subject: [PATCH] cmd: Fix format issues found by clang-format
clang-format finds a few format issues, lets fix these up.
Fix format issues found by clang-format.
Signed-off-by: Tobin C. Harding <me at tobin.cc>
---
src/lxc/cmd/lxc_init.c | 4 ++--
src/lxc/cmd/lxc_monitord.c | 8 ++++----
src/lxc/cmd/lxc_user_nic.c | 18 +++++++++---------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/lxc/cmd/lxc_init.c b/src/lxc/cmd/lxc_init.c
index 75900a9d3..7595989a7 100644
--- a/src/lxc/cmd/lxc_init.c
+++ b/src/lxc/cmd/lxc_init.c
@@ -22,6 +22,7 @@
*/
#define _GNU_SOURCE
+#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <libgen.h>
@@ -30,11 +31,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include <ctype.h>
+#include <unistd.h>
#include <lxc/lxccontainer.h>
#include <lxc/version.h>
diff --git a/src/lxc/cmd/lxc_monitord.c b/src/lxc/cmd/lxc_monitord.c
index e6cb77338..fe0ba7f35 100644
--- a/src/lxc/cmd/lxc_monitord.c
+++ b/src/lxc/cmd/lxc_monitord.c
@@ -24,21 +24,21 @@
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
+#include <net/if.h>
+#include <netinet/in.h>
#include <pthread.h>
+#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <setjmp.h>
#include <sys/epoll.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
+#include <unistd.h>
#include <lxc/lxccontainer.h>
diff --git a/src/lxc/cmd/lxc_user_nic.c b/src/lxc/cmd/lxc_user_nic.c
index 153940b86..2d16904d0 100644
--- a/src/lxc/cmd/lxc_user_nic.c
+++ b/src/lxc/cmd/lxc_user_nic.c
@@ -555,14 +555,14 @@ static int create_nic(char *nic, char *br, int pid, char **cnic)
ret = lxc_netdev_set_mtu(veth1buf, mtu);
if (ret < 0) {
usernic_error("Failed to set mtu to %d on %s\n",
- mtu, veth1buf);
+ mtu, veth1buf);
goto out_del;
}
ret = lxc_netdev_set_mtu(veth2buf, mtu);
if (ret < 0) {
usernic_error("Failed to set mtu to %d on %s\n",
- mtu, veth2buf);
+ mtu, veth2buf);
goto out_del;
}
}
@@ -579,7 +579,7 @@ static int create_nic(char *nic, char *br, int pid, char **cnic)
ret = lxc_netdev_move_by_name(veth2buf, pid, NULL);
if (ret < 0) {
usernic_error("Error moving %s to network namespace of %d\n",
- veth2buf, pid);
+ veth2buf, pid);
goto out_del;
}
@@ -1005,7 +1005,7 @@ static bool may_access_netns(int pid)
ret = access(s, R_OK);
may_access = true;
- if (ret < 0) {
+ if (ret < 0) {
may_access = false;
CMD_SYSERROR("Uid %d may not access %s\n", (int)ruid, s);
}
@@ -1232,7 +1232,7 @@ int main(int argc, char *argv[])
close(netns_fd);
if (!has_priv) {
usernic_error("%s", "Process is not privileged over "
- "network namespace\n");
+ "network namespace\n");
_exit(EXIT_FAILURE);
}
}
@@ -1247,7 +1247,7 @@ int main(int argc, char *argv[])
if (!is_ovs_bridge(args.link)) {
usernic_error("%s", "Deletion of non ovs type network "
- "devices not implemented\n");
+ "devices not implemented\n");
close(fd);
free_alloted(&alloted);
_exit(EXIT_FAILURE);
@@ -1267,15 +1267,15 @@ int main(int argc, char *argv[])
if (!found_nicname) {
usernic_error("Caller is not allowed to delete network "
- "device \"%s\"\n", args.veth_name);
+ "device \"%s\"\n", args.veth_name);
_exit(EXIT_FAILURE);
}
ret = lxc_ovs_delete_port(args.link, args.veth_name);
if (ret < 0) {
usernic_error("Failed to remove port \"%s\" from "
- "openvswitch bridge \"%s\"",
- args.veth_name, args.link);
+ "openvswitch bridge \"%s\"",
+ args.veth_name, args.link);
_exit(EXIT_FAILURE);
}
More information about the lxc-devel
mailing list