mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 05:36:23 +02:00
lbutils/file: don't eintr loop fcntl
not indicated. the way we use it is basically like stat, to check that a file exists / is a file. just err the fuck out nuance: SETLK is non-blocking (no wait). we should loop on SETLKW, but we don't use that. in this codebase, we use SETLK for locking a tmpfile, but because of race conditions and wanting to make another file quickly, we just try again with a newly generated name, with a certain number of retries, so we justt use SETLK Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -48,9 +48,7 @@ open_gbe_file(void)
|
||||
if (f->gbe_st.st_nlink == 0)
|
||||
exitf("%s: file unlinked while open", f->fname);
|
||||
|
||||
while (fs_retry(saved_errno,
|
||||
_flags = fcntl(f->gbe_fd, F_GETFL)));
|
||||
if (_flags == -1)
|
||||
if ((_flags = fcntl(f->gbe_fd, F_GETFL)) == -1)
|
||||
exitf("%s: fcntl(F_GETFL)", f->fname);
|
||||
|
||||
/* O_APPEND allows POSIX write() to ignore
|
||||
|
||||
Reference in New Issue
Block a user