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)
Tue, Apr 29, 2:00 AM
Unknown Object (File)
Tue, Apr 22, 4:52 AM
Unknown Object (File)
Mon, Apr 21, 12:06 AM
Unknown Object (File)
Sat, Apr 19, 3:21 AM
Unknown Object (File)
Apr 9 2025, 1:23 AM
Unknown Object (File)
Apr 8 2025, 7:57 AM
Unknown Object (File)
Mar 18 2025, 11:34 PM
Unknown Object (File)
Feb 22 2025, 5:12 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.