git: 4c00fb987e36 - main - mail/faces: include errno.h for errno

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Tue, 01 Oct 2024 20:12:46 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4c00fb987e36553e29286019b6e62317b5cf0838

commit 4c00fb987e36553e29286019b6e62317b5cf0838
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2024-09-30 18:17:36 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-10-01 20:11:45 +0000

    mail/faces: include errno.h for errno
    
    errno must be accessed by a macro from errno.h.
    
    Also add stdio.h for sys_nerr and sys_errlist.
    
    PR:             281783
    Approved by:    portmgr (build fix blanket), mikael
---
 mail/faces/Makefile                       |  2 +-
 mail/faces/files/patch-compface_cmain.c   | 21 +++++++++++----------
 mail/faces/files/patch-compface_uncmain.c | 23 ++++++++++++-----------
 mail/faces/files/patch-intl_dcgettext.c   | 12 ++++++++++++
 4 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/mail/faces/Makefile b/mail/faces/Makefile
index 6d6969d01a0c..3f69c2a0aeb6 100644
--- a/mail/faces/Makefile
+++ b/mail/faces/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	faces
 PORTVERSION=	1.7.7
-PORTREVISION=	13
+PORTREVISION=	14
 CATEGORIES=	mail
 MASTER_SITES=	SF
 
diff --git a/mail/faces/files/patch-compface_cmain.c b/mail/faces/files/patch-compface_cmain.c
index c3f144a65ad0..12ddc1636d27 100644
--- a/mail/faces/files/patch-compface_cmain.c
+++ b/mail/faces/files/patch-compface_cmain.c
@@ -1,12 +1,14 @@
 --- compface/cmain.c.orig
 +++ compface/cmain.c
-@@ -13,77 +13,64 @@
+@@ -13,77 +13,63 @@
   *  to me, then an attempt will be made to fix them.
   */
  
 -#include <stdlib.h>
 -#include <unistd.h>
++#include <errno.h>
  #include <fcntl.h>
++#include <stdio.h>
  #include "compface.h"
  
 -#define  STRCAT        (void) strcat
@@ -33,11 +35,10 @@
 -/* Error handling definitions follow */
 +/* error handling definitions follow */
  
- extern int errno, sys_nerr;
- extern char *sys_errlist[];
- 
+-extern int errno, sys_nerr;
+-extern char *sys_errlist[];
 +extern void exit P((int)) ;
-+
+ 
  #define ERR         ((errno < sys_nerr) ? sys_errlist[errno] : "")
 -#define INITERR(s)  { \
 -                        STRCPY(fbuf, cmdname); \
@@ -106,7 +107,7 @@
              INITERR(inname)
              ADDERR(": ")
              ADDERR(ERR)
-@@ -91,10 +78,11 @@
+@@ -91,10 +77,11 @@
          }
      }
  
@@ -121,7 +122,7 @@
              INITERR(outname)
              ADDERR(": ")
              ADDERR(ERR)
-@@ -103,7 +91,8 @@
+@@ -103,7 +90,8 @@
      }
  
      (void) ReadBuf();
@@ -131,7 +132,7 @@
          case -2 : INITERR("internal error")
                    ERROR
          case -1 : INITERR(inname)
-@@ -123,13 +112,15 @@
+@@ -123,13 +111,15 @@
  int
  WriteBuf()
  {
@@ -151,7 +152,7 @@
              INITERR(outname)
              ADDERR(": ")
              ADDERR(ERR)
-@@ -137,27 +128,30 @@
+@@ -137,27 +127,30 @@
          }
          s += len;
      }
@@ -188,7 +189,7 @@
              INITWARN(inname)
              ADDWARN(" exceeds internal buffer size.  Data may be lost")
              WARN
-@@ -165,5 +159,5 @@
+@@ -165,5 +158,5 @@
          }
      }
      *t = '\0';
diff --git a/mail/faces/files/patch-compface_uncmain.c b/mail/faces/files/patch-compface_uncmain.c
index c71cab16fad7..fc5fa9a39953 100644
--- a/mail/faces/files/patch-compface_uncmain.c
+++ b/mail/faces/files/patch-compface_uncmain.c
@@ -1,12 +1,14 @@
 --- compface/uncmain.c.orig
 +++ compface/uncmain.c
-@@ -13,16 +13,12 @@
+@@ -13,16 +13,14 @@
   *  to me, then an attempt will be made to fix them.
   */
  
 -#include <stdlib.h>
 -#include <unistd.h>
++#include <errno.h>
  #include <fcntl.h>
++#include <stdio.h>
  #include "compface.h"
  
 -#define  STRCAT        (void) strcat
@@ -19,7 +21,7 @@
  #define FACEBUFLEN 2048
  char fbuf[FACEBUFLEN];
  
-@@ -32,56 +28,58 @@
+@@ -32,56 +30,55 @@
  int outfile   = 1;
  char *outname = "<stdout>";
  
@@ -30,11 +32,10 @@
 -/* Error handling definitions follow */
 +/* error handling definitions follow */
  
- extern int errno, sys_nerr;
- extern char *sys_errlist[];
- 
+-extern int errno, sys_nerr;
+-extern char *sys_errlist[];
 +extern void exit P((int)) ;
-+
+ 
  #define ERR         ((errno < sys_nerr) ? sys_errlist[errno] : "")
 -#define INITERR(s)  { \
 -                        STRCPY(fbuf, cmdname); \
@@ -108,7 +109,7 @@
              INITERR(inname)
              ADDERR(": ")
              ADDERR(ERR)
-@@ -89,10 +87,11 @@
+@@ -89,10 +86,11 @@
          }
      }
  
@@ -123,7 +124,7 @@
              INITERR(outname)
              ADDERR(": ")
              ADDERR(ERR)
-@@ -101,7 +100,8 @@
+@@ -101,7 +99,8 @@
      }
  
      (void) ReadBuf();
@@ -133,7 +134,7 @@
          case -2 : INITERR("internal error")
                    ERROR
          case -1 : INITERR(inname)
-@@ -121,13 +121,15 @@
+@@ -121,13 +120,15 @@
  int
  WriteBuf()
  {
@@ -153,7 +154,7 @@
              INITERR(outname)
              ADDERR(": ")
              ADDERR(ERR)
-@@ -135,27 +137,30 @@
+@@ -135,27 +136,30 @@
          }
          s += len;
      }
@@ -190,7 +191,7 @@
              INITWARN(inname)
              ADDWARN(" exceeds internal buffer size.  Data may be lost")
              WARN
-@@ -163,5 +168,5 @@
+@@ -163,5 +167,5 @@
          }
      }
      *t = '\0';
diff --git a/mail/faces/files/patch-intl_dcgettext.c b/mail/faces/files/patch-intl_dcgettext.c
new file mode 100644
index 000000000000..67111a089265
--- /dev/null
+++ b/mail/faces/files/patch-intl_dcgettext.c
@@ -0,0 +1,12 @@
+--- intl/dcgettext.c.orig	2024-09-30 18:50:01.925202000 +0100
++++ intl/dcgettext.c	2024-09-30 18:51:19.264270000 +0100
+@@ -39,9 +39,6 @@
+ #endif
+ 
+ #include <errno.h>
+-#ifndef errno
+-extern int errno;
+-#endif
+ #ifndef __set_errno
+ # define __set_errno(val) errno = (val)
+ #endif