use gettimeofday for current time
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | git-compat-util: time_now for current timearchive.c blame.c builtin/ +19 more | +37 | 0 replies | |
| 2/2 | git-compat-util: use gettimeofday for current timegit-compat-util.h | +4 | 7 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] use gettimeofday for current time
In recent GNU/Linux versions on rare occasions the 'time' function returns a value that is one second less than the seconds component of the timestamp that would be returned by gettimeofday, clock_gettime with CLOCK_REALTIME, 'stat' on a recently modified file, etc.
If a program calls both 'time' and any of these other functions, the system clock will appear to jump backwards by a second temporarily. This can lead to confusing or inconsistent output.
A simple workaround for Git is to use 'gettimeofday' instead of 'time'. Although other options are possible (see the commit message of patch 0002), simplest is probably best.
Paul Eggert (2):
git-compat-util: time_now for current time
git-compat-util: use gettimeofday for current time
archive.c | 2 +- blame.c | 2 +- builtin/bugreport.c | 2 +- builtin/credential-cache--daemon.c | 4 ++-- builtin/diagnose.c | 2 +- builtin/fast-import.c | 2 +- builtin/fsmonitor--daemon.c | 4 ++-- builtin/gc.c | 2 +- builtin/log.c | 2 +- builtin/receive-pack.c | 2 +- builtin/reflog.c | 2 +- commit-graph.c | 4 ++-- compat/nedmalloc/malloc.c.h | 2 +- credential.c | 4 ++-- date.c | 6 +++--- git-compat-util.h | 8 ++++++++ http-backend.c | 2 +- http-push.c | 6 +++--- rerere.c | 2 +- run-command.c | 4 ++-- t/helper/test-chmtime.c | 4 ++-- t/helper/test-simple-ipc.c | 4 ++-- 22 files changed, 40 insertions(+), 32 deletions(-)
--
2.39.2