HWCAPS subdirectories are found in /usr/lib/glibc-hwcaps/* by default.
Handle all above paths to avoid further problems. There may be more runtime libraries that may require this (if any of snap-confine(8)'s dependencies were built to the HWCAPS microarchitecture levels - but we will just handle them in similar ways, should issues arise.
Signed-off-by: Mingcong Bai <email address hidden>
snapdtool: update command line when re-executing (#14795)
Snap re-execution looked confusing since it did not update `cmdline` in `/proc`. That means `ps`, `top`, `systemd-cgls` showed `/usr/lib/snapd/snapd` as running when the binary comes from the snap.
cmd/snap-confine: workaround time_t size differences between architectures (#15113)
The following error was observed when building for armhf:
snap-confine/snap-confine.c: In function ‘log_startup_stage’: snap-confine/snap-confine.c:280:60: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__time64_t’ {aka ‘long long int’} [-Werror=format=] 280 | debug("-- snap startup {\"stage\":\"%s\", \"time\":\"%lu.%06lu\"}", stage, tv.tv_sec, tv.tv_usec); | ~~^ ~~~~~~~~~ | | | | long unsigned int __time64_t {aka long long int} | %llu snap-confine/snap-confine.c:280:66: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘__suseconds64_t’ {aka ‘long long int’} [-Werror=format=] 280 | debug("-- snap startup {\"stage\":\"%s\", \"time\":\"%lu.%06lu\"}", stage, tv.tv_sec, tv.tv_usec); | ~~~~^ ~~~~~~~~~~ | | | | long unsigned int __suseconds64_t {aka long long int} | %06llu cc1: all warnings being treated as errors
Use proper formatting macros and check for time_t size.
Signed-off-by: Maciej Borzecki <email address hidden>