提交 bc95be5d 编写于 作者: O Osier Yang

cleanup: Remove the duplicate header

Detected by a simple Shell script:

for i in $(git ls-files -- '*.[ch]'); do
    awk 'BEGIN {
        fail=0
    }
    /# *include.*\.h/{
        match($0, /["<][^">]*[">]/)
        arr[substr($0, RSTART+1, RLENGTH-2)]++
    }
    END {
        for (key in arr) {
            if (arr[key] > 1) {
                fail=1
                printf("%d %s\n", arr[key], key)
            }
        }
        if (fail == 1)
            exit 1
    }' $i

    if test $? != 0; then
        echo "Duplicate header(s) in $i"
    fi
done;

A later patch will add the syntax-check to avoid duplicate
headers.
上级 2beae9c2
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include "virnetlink.h" #include "virnetlink.h"
#include "virnetserver.h" #include "virnetserver.h"
#include "remote.h" #include "remote.h"
#include "remote_driver.h"
#include "virhook.h" #include "virhook.h"
#include "viraudit.h" #include "viraudit.h"
#include "locking/lock_manager.h" #include "locking/lock_manager.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "viralloc.h" #include "viralloc.h"
#include "node_device_conf.h" #include "node_device_conf.h"
#include "viralloc.h"
#include "virxml.h" #include "virxml.h"
#include "virutil.h" #include "virutil.h"
#include "virbuffer.h" #include "virbuffer.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "viralloc.h" #include "viralloc.h"
#include "viruuid.h" #include "viruuid.h"
#include "vircommand.h" #include "vircommand.h"
#include "libxl.h"
#include "libxl_driver.h" #include "libxl_driver.h"
#include "libxl_conf.h" #include "libxl_conf.h"
#include "xen_xm.h" #include "xen_xm.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <signal.h> #include <signal.h>
#include <paths.h> #include <paths.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <net/if.h> #include <net/if.h>
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <dirent.h> #include <dirent.h>
#include <time.h> #include <time.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h>
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <paths.h> #include <paths.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h>
#include <sys/wait.h> #include <sys/wait.h>
#include "virerror.h" #include "virerror.h"
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <paths.h> #include <paths.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/statvfs.h> #include <sys/statvfs.h>
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <libssh2.h> #include <libssh2.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
# include "virobject.h" # include "virobject.h"
# include "capabilities.h" # include "capabilities.h"
# include "vircommand.h" # include "vircommand.h"
# include "virobject.h"
# include "qemu_monitor.h" # include "qemu_monitor.h"
/* Internal flags to keep track of qemu command line capabilities */ /* Internal flags to keep track of qemu command line capabilities */
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <signal.h> #include <signal.h>
#include <paths.h> #include <paths.h>
#include <stdio.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/un.h> #include <sys/un.h>
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "virfile.h" #include "virfile.h"
#include "virhash.h" #include "virhash.h"
#include "virrandom.h" #include "virrandom.h"
#include "virutil.h"
#include "virconf.h" #include "virconf.h"
#include "virtpm.h" #include "virtpm.h"
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include <signal.h> #include <signal.h>
#include <paths.h> #include <paths.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/inotify.h> #include <sys/inotify.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "virnetdevopenvswitch.h" #include "virnetdevopenvswitch.h"
#include "virerror.h" #include "virerror.h"
#include "virfile.h" #include "virfile.h"
#include "virerror.h"
#include "viralloc.h" #include "viralloc.h"
#include "virlog.h" #include "virlog.h"
#include "virutil.h" #include "virutil.h"
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <limits.h> #include <limits.h>
#include <stdint.h>
#include <regex.h> #include <regex.h>
#include <errno.h> #include <errno.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册