Bug 292922 - cad/spice: cleaner fix for BSDTIME
Summary: cad/spice: cleaner fix for BSDTIME
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-04 07:25 UTC by Pedro F. Giffuni
Modified: 2026-02-04 15:19 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (hrs)


Attachments
remove BSDTIME from src/include/os_bsd.h (1.22 KB, patch)
2026-02-04 07:25 UTC, Pedro F. Giffuni
no flags Details | Diff
Replace BSDTIME with SYSVTIME (1.22 KB, patch)
2026-02-04 15:19 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer freebsd_triage 2026-02-04 07:25:49 UTC
Created attachment 267759 [details]
remove BSDTIME from src/include/os_bsd.h

A recent commit (46b4e04137ac569c1bbcd3965c087e785c70bc55) removed a bogus timezone()
definition in src/include/misc.h. While this works, it is cleaner to avoid defining
HAS_BSDTIME altogether. gettimeofday(2) is obsolescent according to our manpage so this is consistent with the comment in spice.

FWIW, I reverted the misc.h in my system and tested but for some reason git diff didn't catch it!
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2026-02-04 11:47:58 UTC
I do think we want gettimeofday(), what does the program do if it fails to detect gettimeofday()?  I doubt this project supports clock_gettime().  It may fall back to just time() instead, reducing accuracy to seconds.

Note that the bug is not in gettimeofday(), it's in timezone() which this port does not use.
Comment 2 Pedro F. Giffuni freebsd_committer freebsd_triage 2026-02-04 15:19:19 UTC
Created attachment 267775 [details]
Replace BSDTIME with SYSVTIME

A quick grep for BSDTIME over the spice code appears to show that it doesn't use gettimeofday() at all. The only difference with SYSVTIME is the bogus timezone definition in src/include/misc.h.