fs-util: Drop unlink_noerrno()

This commit is contained in:
Daan De Meyer
2023-03-15 13:27:20 +01:00
parent a45332500d
commit 39eb3ffaaa
6 changed files with 12 additions and 36 deletions
+1 -6
View File
@@ -33,11 +33,6 @@
#include "umask-util.h"
#include "user-util.h"
int unlink_noerrno(const char *path) {
PROTECT_ERRNO;
return RET_NERRNO(unlink(path));
}
int rmdir_parents(const char *path, const char *stop) {
char *p;
int r;
@@ -674,7 +669,7 @@ void unlink_tempfilep(char (*p)[]) {
* successfully created. We ignore both the rare case where the
* original suffix is used and unlink failures. */
if (!endswith(*p, ".XXXXXX"))
(void) unlink_noerrno(*p);
(void) unlink(*p);
}
int unlinkat_deallocate(int fd, const char *name, UnlinkDeallocateFlags flags) {
+1 -3
View File
@@ -22,8 +22,6 @@
#define PTR_TO_MODE(p) ((mode_t) ((uintptr_t) (p)-1))
#define MODE_TO_PTR(u) ((void *) ((uintptr_t) (u)+1))
int unlink_noerrno(const char *path);
int rmdir_parents(const char *path, const char *stop);
int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
@@ -99,7 +97,7 @@ static inline char* unlink_and_free(char *p) {
if (!p)
return NULL;
(void) unlink_noerrno(p);
(void) unlink(p);
return mfree(p);
}
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, unlink_and_free);
+1 -1
View File
@@ -100,7 +100,7 @@ void release_lock_file(LockFile *f) {
f->operation = LOCK_EX|LOCK_NB;
if ((f->operation & ~LOCK_NB) == LOCK_EX)
unlink_noerrno(f->path);
(void) unlink(f->path);
f->path = mfree(f->path);
}