/* * SPDX-FileCopyrightText: 2022 fosslinux * SPDX-FileCopyrightText: 2022 Andrius Štikonas * * SPDX-License-Identifier: GPL-2.0-or-later */ #include #include #include int _lstat(const char *path, struct stat *buf) { int rc = lstat(path, buf); if (rc == 0) { buf->st_atime = 0; buf->st_mtime = 0; } return rc; } /* stat is deliberately hacked to be lstat. In src/system.h tar already defines lstat to be stat since S_ISLNK is not defined in mes C library Hence, we can't use something like #define lstat(a,b) _lstat(a,b) to have separate stat and lstat functions. Thus here we break tar with --dereference option but we don't use this option in live-bootstrap. */ #define stat(a,b) _lstat(a,b)