diff options
Diffstat (limited to 'src/libudev/util.c')
-rw-r--r-- | src/libudev/util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libudev/util.c b/src/libudev/util.c index 93f60b8ec4..a0d7cac697 100644 --- a/src/libudev/util.c +++ b/src/libudev/util.c @@ -284,6 +284,17 @@ void close_nointr_nofail(int fd) { assert_se(close_nointr(fd) == 0); } +int unlink_noerrno(const char *path) { + PROTECT_ERRNO; + int r; + + r = unlink(path); + if (r < 0) + return -errno; + + return 0; +} + int safe_atou(const char *s, unsigned *ret_u) { char *x = NULL; unsigned long l; |