Mike Barcroft <[EMAIL PROTECTED]> writes:
> Nate Lawson <[EMAIL PROTECTED]> writes:
> > cc -O -c -O -pipe -mcpu=pentiumpro -mcpu=pentiumpro -I./../include
> > -I./.. -DDIRENT=1 -DDIRENT=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1
> > -DHAVE_FCNTL_H=1 -DHAVE_ST_RDEV=1 -DHAVE_TM_ZONE=1
> > -DHAVE_LONG_FILE_NAMES=1 -DHAVE_RESTARTABLE_SYSCALLS=1 -D_ANSI_SOURCE
> > -DHAVE_DEV_CONSOLE=1 os.c
> > In file included from os.c:25:
> > /usr/include/sys/file.h:130: syntax error before "u_int"
> > 
> > > u_int is undocumented and unportable, so it probably shouldn't be
> > > used.  It's only 3 characters shorter than `unsigned' anyway.
> > 
> > It's for ports.
> 
> I fixed a port like this recently.  _ANSI_SOURCE was actually added by
> the port, not the application vendor, in that case.

Wait a minute, I think this might be the same port.  Is it gnu-finger?
If so, try the attached patch.  Kris was going to commit it for me.

Best regards,
Mike Barcroft
Index: files/patch-aa
===================================================================
RCS file: /work/repo/ports/net/gnu-finger/files/patch-aa,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-aa
--- files/patch-aa      10 Jul 1996 22:33:13 -0000      1.1.1.1
+++ files/patch-aa      30 Nov 2002 15:55:31 -0000
@@ -1,6 +1,6 @@
---- configure.orig     Fri Oct 16 06:49:05 1992
-+++ configure  Mon Jul  8 19:39:32 1996
-@@ -1041,8 +1041,10 @@
+--- configure.orig     Thu Oct 15 17:49:05 1992
++++ configure  Sat Nov 30 10:55:20 2002
+@@ -1041,8 +1041,8 @@
  
                
                echo checking for /proc file system
@@ -8,12 +8,10 @@
 -              fi
 +#             if test -r /proc ; then DEFS="$DEFS -DHAVE_PROC_FS=1"
 +#             fi
-+
-+              DEFS="$DEFS -D_ANSI_SOURCE"
        
  
                
-@@ -1071,8 +1073,9 @@
+@@ -1071,8 +1071,9 @@
                
  
                
Index: files/patch-ab
===================================================================
RCS file: /work/repo/ports/net/gnu-finger/files/patch-ab,v
retrieving revision 1.3
diff -u -r1.3 patch-ab
--- files/patch-ab      6 Jan 1997 14:09:34 -0000       1.3
+++ files/patch-ab      30 Nov 2002 16:03:57 -0000
@@ -1,7 +1,10 @@
---- lib/os.c.orig      Mon Jan  6 22:09:06 1997
-+++ lib/os.c   Mon Jan  6 22:08:34 1997
-@@ -26,6 +26,8 @@
+--- lib/os.c.orig      Thu Oct 22 17:01:10 1992
++++ lib/os.c   Sat Nov 30 11:03:54 2002
+@@ -24,8 +24,11 @@
+ #include <sys/stat.h>
+ #include <sys/file.h>
  #include <sys/acct.h>
++#include <errno.h>
  #include <time.h>
  #include <packet.h>
 +#include <sys/socket.h>
@@ -9,7 +12,7 @@
  
  #ifdef HAVE_UTMPX_H
  #include <utmpx.h>
-@@ -70,8 +72,12 @@
+@@ -70,8 +73,12 @@
  
  /* Where the utmp file is located. */
  #ifndef HAVE_GETUTENT
@@ -22,7 +25,25 @@
  
  /* A non-null value is the address of the utmp entry which contains the
     information for the user using the console. */
-@@ -288,6 +294,21 @@
+@@ -210,15 +217,12 @@
+ 
+   if (!(hostname = xgethostname ()))
+     {
+-      extern int errno;
+-      extern char *sys_errlist[];
+-
+       /* Arbitrary limit: we only return the first 128 characters of
+        an error. This limit would be too complicated to remove. */
+       static char hostname_error[128];
+ 
+-      strncpy (hostname_error, sys_errlist[errno],
+-             sizeof hostname_error);
++      if (strerror_r(errno, hostname_error, sizeof hostname_error))
++        strcpy(hostname_error, "Unknown error");
+       hostname = hostname_error;
+     }
+ 
+@@ -288,6 +292,21 @@
      {
        idle = current_time - get_last_access (utmplist[i]->ut_line);
  
@@ -44,7 +65,7 @@
        if (idle < 0)
        idle = 0;
  
-@@ -485,6 +506,7 @@
+@@ -485,6 +504,7 @@
  
    UTMP **result;
    int result_size = 0;
@@ -52,7 +73,7 @@
  
  #ifndef HAVE_GETUTENT
    file = open (UTMP_FILE, O_RDONLY);
-@@ -528,6 +550,26 @@
+@@ -528,6 +548,26 @@
        if (!UT (entry, ut_name)[0])
        continue;
  #endif /* sun */
Index: files/patch-error.c
===================================================================
RCS file: files/patch-error.c
diff -N files/patch-error.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/patch-error.c 30 Nov 2002 15:52:45 -0000
@@ -0,0 +1,52 @@
+--- lib/error.c.orig   Thu Oct  1 14:55:04 1992
++++ lib/error.c        Sat Nov 30 10:52:14 2002
+@@ -23,6 +23,7 @@
+ #include <config.h>
+ #include <general.h>
+ #include <error.h>
++#include <errno.h>
+ 
+ /* These can be filled in `manually' by callers, but the easiest way
+    is to call default_error_handling (argv[0]). */
+@@ -50,11 +51,14 @@
+     exit (1);
+ }
+ 
++/* XXX conflicts with system function by the same name. */
++#if __FreeBSD__ < 5
+ /* Hack to handle previous bad setjmp (). */
+ longjmperror ()
+ {
+   exit (1);
+ }
++#endif
+ 
+ /* Handle some error. */
+ void
+@@ -92,24 +96,10 @@
+      int severity;
+      char *filename;
+ {
+-  extern int errno, sys_nerr;
+-  extern char *sys_errlist[];
+-
+-  char *error_text;
+-
+-  if (errno) {
+-    if (errno < sys_nerr)
+-      error_text = sys_errlist[errno];
+-    else
+-      error_text = "(large errno?)";
+-  } else {
+-    error_text = "(Hmm, no error?)";
+-  }
+-
+   if (filename == (char *)NULL)
+-    handle_error (severity, "%s", error_text);
++    handle_error (severity, "%s", strerror(errno));
+   else
+-    handle_error (severity, "%s: %s", filename, error_text);
++    handle_error (severity, "%s: %s", filename, strerror(errno));
+ }
+ 
+ warning (format, arg1, arg2, arg3)
Index: files/patch-savedir.c
===================================================================
RCS file: files/patch-savedir.c
diff -N files/patch-savedir.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/patch-savedir.c       30 Nov 2002 15:52:23 -0000
@@ -0,0 +1,27 @@
+--- lib/savedir.c.orig Fri Oct 16 21:52:40 1992
++++ lib/savedir.c      Sat Nov 30 10:51:46 2002
+@@ -50,8 +50,9 @@
+ 
+ #endif
+ 
+-char *stpcpy ();
+-
++#if __FreeBSD__ < 5
++char *stpcpy (char *, char *);
++#endif
+ 
+ /* Return a freshly allocated string containing the filenames in
+    directory DIR, separated by '\0' characters; the end is marked by two
+@@ -125,6 +126,7 @@
+   return name_space;
+ }
+ 
++#if __FreeBSD__ < 5
+ /* Copy SOURCE into DEST, stopping after copying the first '\0', and
+    return a pointer to the '\0' at the end of DEST; in other words,
+    return DEST + strlen (SOURCE). */
+@@ -138,3 +140,4 @@
+     /* Do nothing. */ ;
+   return dest - 1;
+ }
++#endif

Reply via email to