util: Remove unused cat_file() 82/189982/2
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 25 Sep 2018 11:13:32 +0000 (13:13 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 3 Oct 2018 09:13:11 +0000 (11:13 +0200)
Change-Id: Ie56ce502a4a1d6ca27574bf7f05b0f097079eaa2

src/shared/util.c
src/shared/util.h

index cdf88c2c6c0c179d31f2f88f72abfa3d02c40843..2a76866e2a303e165585363ec36e5d93150d5ee1 100644 (file)
@@ -222,35 +222,6 @@ int copy_file(char *src, char *dst)
        return res;
 }
 
-int cat_file(char *src, char *dst)
-{
-       int res;
-       int sfd;
-       int dfd;
-
-       if (!src || !dst) {
-               _E("Invalid argument\n");
-               return -1;
-       }
-       sfd = open(src, O_RDONLY);
-       if (sfd < 0) {
-               _SE("Failed to open (%s)\n", src);
-               return -1;
-       }
-       dfd = open(dst, O_WRONLY|O_APPEND);
-       if (dfd < 0) {
-               close(sfd);
-               _SE("Failed to open (%s)\n", dst);
-               return -1;
-       }
-
-       res = copy_bytes(dfd, sfd);
-
-       close(sfd);
-       close(dfd);
-       return res;
-}
-
 int move_file(char *src, char *dst)
 {
        if (copy_file(src, dst) < 0)
index afd00e5891b02b8456ebbe7f67ab016cd43dbc40..73078e61f424d8e21d45652ad676f49ebbc95872 100644 (file)
@@ -37,8 +37,6 @@ int write_fd(int fd, const void *buf, int len);
 
 int copy_file(char *src, char *dst);
 
-int cat_file(char *src, char *dst);
-
 int move_file(char *src, char *dst);
 
 int dump_file_write_fd(char *src, int dfd);