criu/compel/arch
Radostin Stoyanov b1a51489dd compel: fix sys_clock_gettime function signature
The initialization of the struct timespec used as clockid input
parameter was removed in commit:
b4441d1bd8 ("restorer.c: rm unneded struct init")

This causes the build to fail on Alpine with clang version 21.1.2:

  GEN      criu/pie/parasite-blob.h
  criu/pie/restorer.c:1230:39: error: variable 'ts' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
   1230 |                         if (sys_clock_gettime(t->clockid, &ts)) {
        |                                                            ^~
  1 error generated.
  make[2]: *** [/criu/scripts/nmk/scripts/build.mk:118: criu/pie/restorer.o] Error 1
  make[1]: *** [criu/Makefile:59: pie] Error 2
  make: *** [Makefile:278: criu] Error 2

To fix this, we remove the "const" from the declaration of
clock_gettime. Since the kernel writes the current time into
the struct timespec provided by the caller, the pointer must
be writable.

Suggested-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2026-01-08 07:48:23 -08:00
..
aarch64 criu/restore: gcs: adds restore implementation for Guarded Control Stack 2025-12-07 19:20:00 +01:00
arm compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00
loongarch64 compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00
mips compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00
ppc64 compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00
riscv64 compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00
s390 compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00
x86 compel: fix sys_clock_gettime function signature 2026-01-08 07:48:23 -08:00