diff options
Diffstat (limited to 'util/libreboot-utils/lib/file.c')
| -rw-r--r-- | util/libreboot-utils/lib/file.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/util/libreboot-utils/lib/file.c b/util/libreboot-utils/lib/file.c index c9ec8f61..552618d6 100644 --- a/util/libreboot-utils/lib/file.c +++ b/util/libreboot-utils/lib/file.c @@ -96,16 +96,16 @@ void xopen(int *fd_ptr, const char *path, int flags, struct stat *st) { if ((*fd_ptr = open(path, flags)) < 0) - err(errno, "%s", path); + err_no_cleanup(0, errno, "%s", path); if (fstat(*fd_ptr, st) < 0) - err(errno, "%s: stat", path); + err_no_cleanup(0, errno, "%s: stat", path); if (!S_ISREG(st->st_mode)) - err(errno, "%s: not a regular file", path); + err_no_cleanup(0, errno, "%s: not a regular file", path); if (lseek_on_eintr(*fd_ptr, 0, SEEK_CUR, 1, 1) == (off_t)-1) - err(errno, "%s: file not seekable", path); + err_no_cleanup(0, errno, "%s: file not seekable", path); } /* fsync() the directory of a file, @@ -787,7 +787,12 @@ fs_resolve_at(int dirfd, const char *path, int flags) int nextfd = -1; int curfd; const char *p; - char name[256]; +#if defined(PATH_LEN) && \ + ((PATH_LEN) >= 256) + char name[PATH_LEN]; +#else + char name[4096]; +#endif int saved_errno = errno; int r; int is_last; |
