projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ffecbb
)
fs-util: move attempts counter in openat_report_new() into loop
author
Lennart Poettering
<lennart@poettering.net>
Tue, 22 Oct 2024 15:49:40 +0000
(17:49 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 22 Oct 2024 15:51:26 +0000
(17:51 +0200)
src/basic/fs-util.c
patch
|
blob
|
history
diff --git
a/src/basic/fs-util.c
b/src/basic/fs-util.c
index 9397c4b38497b8c888abffe8c278af8fc918f718..7c88e9fef7ef7f555256d04cf63d0a51f216ca89 100644
(file)
--- a/
src/basic/fs-util.c
+++ b/
src/basic/fs-util.c
@@
-1077,7
+1077,6
@@
int open_mkdir_at_full(int dirfd, const char *path, int flags, XOpenFlags xopen_
}
int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, bool *ret_newly_created) {
- unsigned attempts = 7;
int fd;
/* Just like openat(), but adds one thing: optionally returns whether we created the file anew or if
@@
-1099,7
+1098,7
@@
int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, b
return fd;
}
- for (;;) {
+ for (
unsigned attempts = 7
;;) {
/* First, attempt to open without O_CREAT/O_EXCL, i.e. open existing file */
fd = openat(dirfd, pathname, flags & ~(O_CREAT | O_EXCL), mode);
if (fd >= 0) {