]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove obsolete file_is_compressed function
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 5 Jun 2019 19:53:44 +0000 (21:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 5 Jun 2019 19:53:44 +0000 (21:53 +0200)
src/ccache.h
src/util.c

index a2694d1a6112973e6a7aa10781e32ba5c3f8d97b..485494f8c66bae0a542dd35c637187a9ff6d5130 100644 (file)
@@ -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);
index 625a75f2f43f211586b6a583803604f4f39910fb..6771314101d162068ce4d5eaab043500e63c3f10 100644 (file)
@@ -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)