Subject: bug#65294: [PATCH] maint: Fix compilation error on GNU/Hurd

From: Bruno Haible <[email-masked]>
Date: Mon, 14 Aug 2023 21:02:03 +0200

Compiling a current coreutils on Debian GNU/Hurd from 2022, I get this
compilation error:

  CC       src/copy.o
../src/copy.c: In function 'set_author':
../src/copy.c:984:15: error: 'MACH_PORT_nullptr' undeclared (first use in this function); did you mean 'MACH_PORT_NULL'?
  984 |   if (file == MACH_PORT_nullptr)
      |               ^~~~~~~~~~~~~~~~~
      |               MACH_PORT_NULL
../src/copy.c:984:15: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:12489: src/copy.o] Error 1

The attached patch fixes it.

>From 2046827462094dde4ac8391865a3edc74e313126 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email-masked]>
Date: Mon, 14 Aug 2023 20:59:41 +0200
Subject: [PATCH] maint: Fix compilation error on GNU/Hurd (regression
 2023-06-29)

* src/copy.c (set_author): Revert change from MACH_PORT_NULL to
MACH_PORT_nullptr.
---
 src/copy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/copy.c b/src/copy.c
index 90eebf6bc..a4aad06a8 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -981,7 +981,7 @@ set_author (char const *dst_name, int dest_desc, const struct stat *src_sb)
   file_t file = (dest_desc < 0
                  ? file_name_lookup (dst_name, 0, 0)
                  : getdport (dest_desc));
-  if (file == MACH_PORT_nullptr)
+  if (file == MACH_PORT_NULL)
     error (0, errno, _("failed to lookup file %s"), quoteaf (dst_name));
   else
     {
-- 
2.34.1