diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-16 15:33:02 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-16 15:33:02 +0000 |
| commit | 37387a8e2d49cca9d0629c3acfe3f15babbb0bf8 (patch) | |
| tree | 5c3d1fd0d796ebd8a341ed7f70c29c5c77354514 | |
| parent | 36344f84b5e62c8782c643050a887d7abe11bbbf (diff) | |
util/nvmutil: portable struct timeval
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index f5c588be..0f69d27a 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -221,7 +221,6 @@ also consider: #include <sys/param.h> #endif #include <sys/types.h> -#include <sys/time.h> #include <sys/stat.h> #include <errno.h> @@ -361,6 +360,14 @@ static void check_command_num(size_t c); static u8 valid_command(size_t c); /* + * portable timeval + */ +struct x_st_timeval { + long tv_sec; + long tv_usec; +}; + +/* * Helper functions for command: setmac */ static void cmd_helper_setmac(void); @@ -373,7 +380,7 @@ static ushort hextonum(char ch_s); static ushort rhex(void); static ushort read_urandom(void); static ulong entropy_jitter(void); -static int x_i_gettimeofday(struct timeval *tv, void *tz); +static int x_i_gettimeofday(struct x_st_timeval *tv, void *tz); static void write_mac_part(size_t partnum); /* @@ -1349,7 +1356,7 @@ hextonum(char ch_s) static ushort rhex(void) { - struct timeval tv; + struct x_st_timeval tv; ulong mix; static ulong counter = 0; ushort r; @@ -1421,7 +1428,7 @@ read_urandom(void) static ulong entropy_jitter(void) { - struct timeval a, b; + struct x_st_timeval a, b; ulong mix = 0; long mix_diff; int i; @@ -1446,8 +1453,10 @@ entropy_jitter(void) return mix; } + + static int -x_i_gettimeofday(struct timeval *tv, void *tz) +x_i_gettimeofday(struct x_st_timeval *tv, void *tz) { time_t t; |
