diff options
author | Eric Biggers <ebiggers@google.com> | 2020-05-13 22:28:18 -0700 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2020-05-13 22:28:18 -0700 |
commit | ae75f37c4ade32dffda0e440ffc93a7249e5aade (patch) | |
tree | d479c08fcb139effa974efd35cf6aa2ea87dad8c | |
parent | cdaefaa25811c4389e7528fc47ba74e6e21fe0c9 (diff) | |
download | fsverity-utils-ae75f37c4ade32dffda0e440ffc93a7249e5aade.tar.gz |
Include local headers first
It's best practice to include local headers before standard headers.
Signed-off-by: Eric Biggers <ebiggers@google.com>
-rw-r--r-- | cmd_enable.c | 8 | ||||
-rw-r--r-- | cmd_measure.c | 8 | ||||
-rw-r--r-- | cmd_sign.c | 8 | ||||
-rw-r--r-- | commands.h | 4 | ||||
-rw-r--r-- | fsverity.c | 6 | ||||
-rw-r--r-- | hash_algs.c | 6 | ||||
-rw-r--r-- | hash_algs.h | 4 | ||||
-rw-r--r-- | util.c | 4 |
8 files changed, 24 insertions, 24 deletions
diff --git a/cmd_enable.c b/cmd_enable.c index 1646299..cc22f17 100644 --- a/cmd_enable.c +++ b/cmd_enable.c @@ -7,6 +7,10 @@ * Written by Eric Biggers. */ +#include "commands.h" +#include "fsverity_uapi.h" +#include "hash_algs.h" + #include <fcntl.h> #include <getopt.h> #include <limits.h> @@ -14,10 +18,6 @@ #include <string.h> #include <sys/ioctl.h> -#include "commands.h" -#include "fsverity_uapi.h" -#include "hash_algs.h" - static bool parse_hash_alg_option(const char *arg, u32 *alg_ptr) { char *end; diff --git a/cmd_measure.c b/cmd_measure.c index 574e3ca..e8218ab 100644 --- a/cmd_measure.c +++ b/cmd_measure.c @@ -7,14 +7,14 @@ * Written by Eric Biggers. */ -#include <fcntl.h> -#include <stdlib.h> -#include <sys/ioctl.h> - #include "commands.h" #include "fsverity_uapi.h" #include "hash_algs.h" +#include <fcntl.h> +#include <stdlib.h> +#include <sys/ioctl.h> + /* Display the measurement of the given verity file(s). */ int fsverity_cmd_measure(const struct fsverity_command *cmd, int argc, char *argv[]) @@ -7,6 +7,10 @@ * Written by Eric Biggers. */ +#include "commands.h" +#include "fsverity_uapi.h" +#include "hash_algs.h" + #include <fcntl.h> #include <getopt.h> #include <limits.h> @@ -17,10 +21,6 @@ #include <stdlib.h> #include <string.h> -#include "commands.h" -#include "fsverity_uapi.h" -#include "hash_algs.h" - /* * Merkle tree properties. The file measurement is the hash of this structure * excluding the signature and with the sig_size field set to 0. @@ -2,10 +2,10 @@ #ifndef COMMANDS_H #define COMMANDS_H -#include <stdio.h> - #include "util.h" +#include <stdio.h> + struct fsverity_command; void usage(const struct fsverity_command *cmd, FILE *fp); @@ -7,14 +7,14 @@ * Written by Eric Biggers. */ +#include "commands.h" +#include "hash_algs.h" + #include <limits.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include "commands.h" -#include "hash_algs.h" - static const struct fsverity_command { const char *name; int (*func)(const struct fsverity_command *cmd, int argc, char *argv[]); diff --git a/hash_algs.c b/hash_algs.c index 7251bf2..bb153de 100644 --- a/hash_algs.c +++ b/hash_algs.c @@ -7,13 +7,13 @@ * Written by Eric Biggers. */ +#include "fsverity_uapi.h" +#include "hash_algs.h" + #include <openssl/evp.h> #include <stdlib.h> #include <string.h> -#include "fsverity_uapi.h" -#include "hash_algs.h" - /* ========== libcrypto (OpenSSL) wrappers ========== */ struct openssl_hash_ctx { diff --git a/hash_algs.h b/hash_algs.h index 3e90f49..913c918 100644 --- a/hash_algs.h +++ b/hash_algs.h @@ -2,10 +2,10 @@ #ifndef HASH_ALGS_H #define HASH_ALGS_H -#include <stdio.h> - #include "util.h" +#include <stdio.h> + struct fsverity_hash_alg { const char *name; unsigned int digest_size; @@ -7,6 +7,8 @@ * Written by Eric Biggers. */ +#include "util.h" + #include <errno.h> #include <fcntl.h> #include <limits.h> @@ -17,8 +19,6 @@ #include <sys/stat.h> #include <unistd.h> -#include "util.h" - /* ========== Memory allocation ========== */ void *xmalloc(size_t size) |