From 3da297a49ccb53b2940454492b3893a493e59614 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 14 Nov 2021 09:41:04 +0000 Subject: rpm: code shrink Since the WIN32 implementation of chown(2) does nothing there's no point in calling it. Saves 112 bytes. --- archival/rpm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/archival/rpm.c b/archival/rpm.c index 63d13d0e1..d83c33137 100644 --- a/archival/rpm.c +++ b/archival/rpm.c @@ -249,6 +249,7 @@ static void fileaction_dobackup(char *filename, int fileref) } } +#if !ENABLE_PLATFORM_MINGW32 static void fileaction_setowngrp(char *filename, int fileref) { /* real rpm warns: "user foo does not exist - using " */ @@ -258,6 +259,7 @@ static void fileaction_setowngrp(char *filename, int fileref) int gid = gr ? gr->gr_gid : getgid(); chown(filename, uid, gid); } +#endif static void loop_through_files(int filetag, void (*fileaction)(char *filename, int fileref)) { @@ -422,8 +424,10 @@ int rpm_main(int argc, char **argv) loop_through_files(TAG_BASENAMES, fileaction_dobackup); /* Extact the archive */ extract_cpio(rpm_fd, source_rpm); +#if !ENABLE_PLATFORM_MINGW32 /* Set the correct file uid/gid's */ loop_through_files(TAG_BASENAMES, fileaction_setowngrp); +#endif } else if ((func & (rpm_query|rpm_query_package)) == (rpm_query|rpm_query_package)) { -- cgit v1.2.3-55-g6feb