[CRIU] [PATCH 4/6] Remove duplicated include statements

Radostin Stoyanov rstoyanov1 at gmail.com
Sat Nov 10 00:51:24 MSK 2018


for filename in *.c; do
    if sort "$filename" | uniq -d | grep include; then
        echo "$filename"
    fi
done

Signed-off-by: Radostin Stoyanov <rstoyanov1 at gmail.com>
---
 criu/cr-check.c   | 1 -
 criu/cr-dump.c    | 2 --
 criu/cr-restore.c | 2 --
 criu/cr-service.c | 2 --
 criu/eventfd.c    | 1 -
 criu/eventpoll.c  | 1 -
 criu/fsnotify.c   | 1 -
 criu/mount.c      | 1 -
 criu/util.c       | 6 ------
 9 files changed, 17 deletions(-)

diff --git a/criu/cr-check.c b/criu/cr-check.c
index 49ad6582..7addb9fb 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -9,7 +9,6 @@
 #include <sys/signalfd.h>
 #include <sys/ptrace.h>
 #include <sys/wait.h>
-#include <sys/socket.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <linux/if.h>
diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index e907a6e3..f2c446e8 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1,4 +1,3 @@
-#include <sys/time.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -14,7 +13,6 @@
 #include <sys/stat.h>
 #include <sys/vfs.h>
 #include <sys/time.h>
-#include <sys/resource.h>
 #include <sys/wait.h>
 
 
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index cb80f47b..ab82441b 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -38,7 +38,6 @@
 #include "sk-packet.h"
 #include "common/lock.h"
 #include "files.h"
-#include "files-reg.h"
 #include "pipes.h"
 #include "fifo.h"
 #include "sk-inet.h"
@@ -67,7 +66,6 @@
 #include "plugin.h"
 #include "cgroup.h"
 #include "timerfd.h"
-#include "file-lock.h"
 #include "action-scripts.h"
 #include "shmem.h"
 #include <compel/compel.h>
diff --git a/criu/cr-service.c b/criu/cr-service.c
index ed83fdf3..36d9adef 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -37,8 +37,6 @@
 #include "irmap.h"
 #include "kerndat.h"
 #include "proc_parse.h"
-#include <sys/un.h>
-#include <sys/socket.h>
 #include "common/scm.h"
 #include "uffd.h"
 
diff --git a/criu/eventfd.c b/criu/eventfd.c
index a3facada..da31ce9f 100644
--- a/criu/eventfd.c
+++ b/criu/eventfd.c
@@ -3,7 +3,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include <string.h>
 #include <limits.h>
 #include <sys/stat.h>
diff --git a/criu/eventpoll.c b/criu/eventpoll.c
index 72e19e09..e1384fa4 100644
--- a/criu/eventpoll.c
+++ b/criu/eventpoll.c
@@ -3,7 +3,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include <string.h>
 #include <limits.h>
 #include <sys/stat.h>
diff --git a/criu/fsnotify.c b/criu/fsnotify.c
index 916e121c..41b33765 100644
--- a/criu/fsnotify.c
+++ b/criu/fsnotify.c
@@ -3,7 +3,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include <signal.h>
 #include <string.h>
 #include <utime.h>
diff --git a/criu/mount.c b/criu/mount.c
index 218facb7..5a97c1f1 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -7,7 +7,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <sys/mount.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <sched.h>
 
diff --git a/criu/util.c b/criu/util.c
index bc98aa38..4301020c 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -8,8 +8,6 @@
 #include <limits.h>
 #include <signal.h>
 #include <unistd.h>
-#include <errno.h>
-#include <string.h>
 #include <dirent.h>
 #include <sys/sendfile.h>
 #include <fcntl.h>
@@ -19,14 +17,10 @@
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/ptrace.h>
-#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
-#include <sys/ptrace.h>
-#include <sys/wait.h>
-#include <sys/resource.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <netdb.h>
-- 
2.17.2



More information about the CRIU mailing list