diff options
Diffstat (limited to 'util/libreboot-utils/include/common.h')
| -rw-r--r-- | util/libreboot-utils/include/common.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h index 652b8c08..1932b2da 100644 --- a/util/libreboot-utils/include/common.h +++ b/util/libreboot-utils/include/common.h @@ -225,10 +225,12 @@ int fchmod(int fd, mode_t mode); /* command table */ +typedef void (*func_t)(void); + struct commands { size_t chk; char *str; - void (*run)(void); + func_t run; int argc; unsigned char arg_part; unsigned char chksum_read; @@ -344,7 +346,6 @@ int fd_verify_dir_identity(int fd, int is_owner(struct stat *st); int lock_file(int fd, int flags); int same_file(int fd, struct stat *st_old, int check_size); -void xopen(int *fd, const char *path, int flags, struct stat *st); /* Read GbE file and verify checksums */ @@ -488,12 +489,12 @@ int try_err(int loop_err, int errval); */ void usage(void); -void err_no_cleanup(int stfu, int nvm_errval, const char *msg, ...); -void b0rk(int nvm_errval, const char *msg, ...); -int exit_cleanup(void); +int set_errno(int saved_errno, int fallback); +void err_exit(int nvm_errval, const char *msg, ...); +func_t errhook(func_t ptr); /* hook function for cleanup on err */ const char *getnvmprogname(void); - -void err_mkhtemp(int stfu, int errval, const char *msg, ...); +void no_op(void); +void err_mkhtemp(int errval, const char *msg, ...); /* libc hardening */ @@ -538,14 +539,14 @@ int secure_file(int *fd, int check_seek, int do_lock, mode_t mode); -int close_on_eintr(int fd); +void close_on_eintr(int *fd); int fsync_on_eintr(int fd); int fs_rename_at(int olddirfd, const char *old, int newdirfd, const char *new); int fs_open(const char *path, int flags); -void close_no_err(int *fd); void free_and_set_null(char **buf); -int close_warn(int *fd, char *s); +void open_on_eintr(const char *path, int *fd, int flags, mode_t mode, + struct stat *st); struct filesystem *rootfs(void); int fs_resolve_at(int dirfd, const char *path, int flags); int fs_next_component(const char **p, |
