Page MenuHomeFreeBSD

fattime: make the test code build again
ClosedPublic

Authored by jeffpc_josefsipek.net on Apr 12 2024, 2:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 4 2024, 6:02 AM
Unknown Object (File)
May 1 2024, 8:04 AM
Unknown Object (File)
Apr 26 2024, 5:04 AM
Unknown Object (File)
Apr 16 2024, 3:56 AM
Unknown Object (File)
Apr 14 2024, 5:05 PM
Subscribers

Details

Summary

This change...

  1. replaces calls to timet2fattime/fattime2timet with calls to timespec2fattime/fattime2timespec. The functions got renamed shortly after they landed in the kernel but the test code wasn't updated (see 7ea93e912bf0ef).
  2. adds a utc_offset stub.

With this, the test code builds and runs as a 32-bit binary (cc -Wall -O2
-m32 subr_fattime.c).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/subr_fattime.c
301

why 1?

sys/kern/subr_fattime.c
301

I'm not happy with hardcoding 1 like this, but...

  1. the original test code assumed UTC (the subsequent change that renamed the functions (and broke the test) also added the int utc arg) and using 1 keeps the test UTC-based (not that it matters since the stub for utc_offset() always returns 0)
  2. the arg is int, so it seems wrong to use anything other than 0 or 1.
This revision is now accepted and ready to land.Apr 28 2024, 8:48 PM
This revision was automatically updated to reflect the committed changes.