chiark / gitweb /
copy: wrap some unlink() calls in (void) casts
authorLennart Poettering <lennart@poettering.net>
Fri, 9 Feb 2018 08:50:13 +0000 (09:50 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:58:53 +0000 (07:58 +0200)
src/basic/copy.c

index 7d5f2d37c6b9bab6da2f3cd8aff2c3eba17e7418..d1ca6f2686c3bca1c4cf89eb3f9db3fe69dc4b2f 100644 (file)
@@ -242,7 +242,7 @@ static int fd_copy_regular(
 
         r = copy_bytes(fdf, fdt, (uint64_t) -1, copy_flags);
         if (r < 0) {
-                unlinkat(dt, to, 0);
+                (void) unlinkat(dt, to, 0);
                 return r;
         }
 
@@ -264,7 +264,7 @@ static int fd_copy_regular(
 
         if (q < 0) {
                 r = -errno;
-                unlinkat(dt, to, 0);
+                (void) unlinkat(dt, to, 0);
         }
 
         return r;
@@ -528,7 +528,7 @@ int copy_file(const char *from, const char *to, int flags, mode_t mode, unsigned
         r = copy_file_fd(from, fdt, copy_flags);
         if (r < 0) {
                 close(fdt);
-                unlink(to);
+                (void) unlink(to);
                 return r;
         }