- Use uid_t not __uid_t.
- Define _GNU_SOURCE for cpu_set_t and others.
- Include string.h for strncmp().
- Detect musl's ldd error message.
if (ret == 0) {
struct timeval tv[2];
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
- if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0)
+ if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0)
log_error("Failed to chown %s: %m", dst);
tv[0].tv_sec = sb.st_atime;
tv[0].tv_usec = 0;
break;
}
+ /* musl ldd */
+ if (strstr(buf, "Not a valid dynamic program"))
+ break;
+
+ /* glibc */
if (strstr(buf, "not a dynamic executable"))
break;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#define _GNU_SOURCE
+
#include <inttypes.h>
#include <time.h>
#include <sys/time.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <signal.h>
#include <sched.h>
#include <limits.h>