mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
nvmutil: use uintptr for gbe. check regular file.
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2022-2025 Leah Rowe <leah@libreboot.org> */
|
||||
/* Copyright (c) 2022-2026 Leah Rowe <leah@libreboot.org> */
|
||||
/* Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com> */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -55,7 +55,8 @@ uint8_t hextonum(char chs), rhex(void);
|
||||
|
||||
uint16_t mac[3] = {0, 0, 0};
|
||||
ssize_t nf;
|
||||
size_t partsize, gbe[2];
|
||||
size_t partsize;
|
||||
uintptr_t gbe[2];
|
||||
uint8_t nvmPartChanged[2] = {0, 0}, do_read[2] = {1, 1};
|
||||
int flags, rfd, fd, part;
|
||||
|
||||
@@ -199,6 +200,7 @@ openFiles(const char *path)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
xopen(rfd, "/dev/urandom", O_RDONLY);
|
||||
xopen(fd, path, flags);
|
||||
|
||||
switch(st.st_size) {
|
||||
@@ -213,7 +215,8 @@ openFiles(const char *path)
|
||||
break;
|
||||
}
|
||||
|
||||
xopen(rfd, "/dev/urandom", O_RDONLY);
|
||||
if (if_err(!S_ISREG(st.st_mode), EBADF))
|
||||
err(EXIT_FAILURE, "Not a GbE file");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user