OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 31-Mar-2005 18:04:05
Branch: HEAD Handle: 2005033117040500
Modified files:
openpkg-src/swhoisd swhoisd.patch
Log:
try to get it running under FreeBSD 4.x and similar old platforms, too
Summary:
Revision Changes Path
1.2 +48 -7 openpkg-src/swhoisd/swhoisd.patch
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/swhoisd/swhoisd.patch
============================================================================
$ cvs diff -u -r1.1 -r1.2 swhoisd.patch
--- openpkg-src/swhoisd/swhoisd.patch 31 Mar 2005 14:37:37 -0000 1.1
+++ openpkg-src/swhoisd/swhoisd.patch 31 Mar 2005 16:04:05 -0000 1.2
@@ -71,8 +71,49 @@
default:
Index: src/sysutils.c
--- src/sysutils.c.orig 2004-01-04 06:38:16 +0100
-+++ src/sysutils.c 2005-03-31 16:30:41 +0200
-@@ -77,7 +77,7 @@
++++ src/sysutils.c 2005-03-31 18:02:25 +0200
+@@ -31,6 +31,40 @@
+ #include <grp.h> /* getgrnam_r() */
+ #include <pwd.h> /* getpwnam_r() */
+
++#ifdef __FreeBSD__
++#include <osreldate.h>
++#endif
++#if !((defined(__FreeBSD__) && __FreeBSD_version >= 500000) ||
defined(__linux__) || defined(__sun__))
++int my_getpwnam_r(const char *name, struct passwd *pwd, char *buffer,
size_t bufsize, struct passwd **result)
++{
++ int rv = 0;
++ struct passwd *lpwd;
++
++ if ((lpwd = getpwnam(name)) != NULL)
++ memcpy(pwd, lpwd, sizeof(struct passwd));
++ else
++ rv = errno;
++ if (result != NULL)
++ *result = (rv == 0 ? pwd : NULL);
++ return rv;
++}
++int my_getgrnam_r(const char *name, struct group *grp, char *buffer, size_t
bufsize, struct group **result)
++{
++ int rv = 0;
++ struct group *lgrp;
++
++ if ((lgrp = getgrnam(name)) != NULL)
++ memcpy(grp, lgrp, sizeof(struct group));
++ else
++ rv = errno;
++ if (result != NULL)
++ *result = (rv == 0 ? grp : NULL);
++ return rv;
++}
++#define getpwnam_r my_getpwnam_r
++#define getgrnam_r my_getgrnam_r
++#endif
++
+ /*
+ * Socket stuff
+ */
+@@ -77,7 +111,7 @@
}
@@ -81,7 +122,7 @@
/*
* Return 1 if the fd is of the specified type, 0 if not, -1 on error.
* Present in Linux (sys/socket.h), but not Solaris.
-@@ -171,6 +171,19 @@
+@@ -171,6 +205,19 @@
(void) dup(0);
(void) dup(0);
@@ -101,7 +142,7 @@
return (0); /* OK */
}
-@@ -187,7 +200,7 @@
+@@ -187,7 +234,7 @@
time_t curtime = 0L;
struct tm *loctime = NULL;
struct tm tm_buf;
@@ -110,7 +151,7 @@
time_t timezone_minutes;
if ((buffer == NULL) || (buffer_size <= 0)) {
-@@ -201,6 +214,9 @@
+@@ -201,6 +248,9 @@
(void) memset(&tm_buf, 0, sizeof (tm_buf));
loctime = localtime_r(&curtime, &tm_buf);
@@ -120,7 +161,7 @@
/* Immediately save global variable and adjust seconds to minutes: */
timezone_minutes = timezone / 60;
-@@ -941,6 +957,7 @@
+@@ -941,6 +991,7 @@
/* Startup message: */
print_syslog(LOG_NOTICE, MYNAME " initialized\n");
@@ -128,7 +169,7 @@
listenfd = tcp_listen(NULL, WHOIS_SERVICE, &addrlen);
if (listenfd < 0) { /* Try port number instead of service name */
listenfd = tcp_listen(NULL, WHOIS_PORT, &addrlen);
-@@ -948,6 +965,11 @@
+@@ -948,6 +999,11 @@
return (-1); /* error */
}
}
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]