From 41e7eb3adbcc809d581c4bdc8648ae4928daa3e7 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 5 Jun 2019 21:53:44 +0200 Subject: [PATCH] Remove obsolete file_is_compressed function --- src/ccache.h | 1 - src/util.c | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/src/ccache.h b/src/ccache.h index a2694d1a6..485494f8c 100644 --- a/src/ccache.h +++ b/src/ccache.h @@ -154,7 +154,6 @@ int copy_file(const char *src, const char *dest, int compress_level); int move_file(const char *src, const char *dest, int compress_level); int move_uncompressed_file(const char *src, const char *dest, int compress_level); -bool file_is_compressed(const char *filename); int create_dir(const char *dir); int create_parent_dirs(const char *path); const char *get_hostname(void); diff --git a/src/util.c b/src/util.c index 625a75f2f..677131410 100644 --- a/src/util.c +++ b/src/util.c @@ -513,25 +513,6 @@ move_uncompressed_file(const char *src, const char *dest, int compress_level) } } -// Test if a file is zlib compressed. -bool -file_is_compressed(const char *filename) -{ - FILE *f = fopen(filename, "rb"); - if (!f) { - return false; - } - - // Test if file starts with 1F8B, which is zlib's magic number. - if ((fgetc(f) != 0x1f) || (fgetc(f) != 0x8b)) { - fclose(f); - return false; - } - - fclose(f); - return true; -} - // Make sure a directory exists. int create_dir(const char *dir) -- 2.47.2