Subject: Re: bug#32305: mingw vs do_chown in gzip

From: Paul Eggert <[email-masked]>
Date: Sat, 4 Aug 2018 00:39:34 -0700

Bdale Garbee wrote:
> That fixes the compilation of gzip.c, but of course causes a link
> failure since it leaves two calls to function do_chown() that is no
> longer defined.

I installed into Savannah master the attached patch, which should be a bit 
cleaner. Does it fix things for you?
From 385faa488bd98691cfb82ec4a317c7720a6008ae Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 4 Aug 2018 00:37:43 -0700
Subject: [PATCH] gzip: port better to mingw again

Problem reported by Bdale Garbee (Bug#32305#8).
* gzip.c (do_chown): Use HAVE_FCHOWN || HAVE_CHOWN,
which is configured, instead of DO_CHOWN, which is not.
---
 gzip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gzip.c b/gzip.c
index 02d5364..b26dd14 100644
--- a/gzip.c
+++ b/gzip.c
@@ -1923,7 +1923,7 @@ local int check_ofname()
    the file and NAME its name.  Change it to user UID and to group GID.
    If UID or GID is -1, though, do not change the corresponding user
    or group.  */
-#ifdef NO_CHOWN
+#if ! (HAVE_FCHOWN || HAVE_CHOWN)
 /* The types uid_t and gid_t do not exist on mingw, so don't assume them.  */
 # define do_chown(fd, name, uid, gid) ((void) 0)
 #else
-- 
2.17.1