← Commit list

d71c7892a

Denys Vlasenko
Denys Vlasenko
2021-06-20
SUCCESS Duration: 163s

Subject

shred: with -u, unlink file even if it is zero length

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/shred.c+5 -5
@@ -99,12 +99,12 @@ int shred_main(int argc UNUSED_PARAM, char **argv)
bb_copyfd_size(zero_fd, fd, size);
fdatasync(fd);
}
- if (opt & OPT_u) {
- ftruncate(fd, 0);
- xunlink(fname);
- }
- xclose(fd);
}
+ if (opt & OPT_u) {
+ ftruncate(fd, 0);
+ xunlink(fname);
+ }
+ xclose(fd);
}
return EXIT_SUCCESS;