pkgsrc/mail/smtpfeed/patches/patch-ai
taca eb4e3f21ac Add patches for reduce/resolve compile problem with gcc-4, especially
on NetBSD/powerpc reported by Makoto Fujiwara.

These patches are slightly aggressive adding most of proto type.
So, please report me if there is any problem.

No PKGREVISION bump since it should change nothing for binary package.
2006-07-23 15:00:41 +00:00

136 lines
3.5 KiB
Text

$NetBSD: patch-ai,v 1.1 2006/07/23 15:00:41 taca Exp $
--- main.c.orig 2002-03-15 11:12:59.000000000 +0900
+++ main.c
@@ -46,7 +46,10 @@
# define MAIN 1
# include "extern.h"
-void
+static void usage P((char *));
+static void sig_quit P((int));
+
+static void
usage(progname)
char *progname;
{
@@ -96,7 +99,8 @@
}
static void
-sig_quit()
+sig_quit(dummy)
+ int dummy;
{
exit(EX_TEMPFAIL);
}
@@ -155,7 +159,9 @@
else
cnf.dst_port = 25;
+#if SPT_TYPE != SPT_BUILTIN
initsetproctitle(argc, argv, envp);
+#endif
opterr = 0;
#ifdef INET6
@@ -455,14 +461,14 @@
switch (peername.in.sin_family)
{
case AF_INET:
- log(LOG_INFO, "connected from %s",
+ mylog(LOG_INFO, "connected from %s",
inet_ntoa(peername.in.sin_addr));
break;
#ifdef INET6
case AF_INET6:
inet_ntop(AF_INET6, &peername.in6.sin6_addr,
buf, sizeof(buf));
- log(LOG_INFO, "connected from %s", buf);
+ mylog(LOG_INFO, "connected from %s", buf);
break;
#endif
}
@@ -470,7 +476,7 @@
if (cnf.sd_max > MAX_SOCK)
{
- log(LOG_INFO, "cnf.sd_max should not be greater than %d, recompile smtpfeed with greater FD_SETSIZE", MAX_SOCK);
+ mylog(LOG_INFO, "cnf.sd_max should not be greater than %d, recompile smtpfeed with greater FD_SETSIZE", MAX_SOCK);
cnf.sd_max = MAX_SOCK;
}
#ifdef RLIMIT_NOFILE
@@ -478,14 +484,14 @@
{
if (limit.rlim_max - 1 < cnf.sd_max)
{
- log(LOG_INFO, "cnf.sd_max should be %d",
+ mylog(LOG_INFO, "cnf.sd_max should be %d",
limit.rlim_max - 1);
cnf.sd_max = limit.rlim_max - 1;
}
limit.rlim_cur = limit.rlim_max; /* make soft limit the max */
if (setrlimit(RLIMIT_NOFILE, &limit) == -1)
{
- log(LOG_NOTICE, "can't set max sd to %d",
+ mylog(LOG_NOTICE, "can't set max sd to %d",
limit.rlim_cur);
}
}
@@ -494,18 +500,18 @@
#if SHOW_UID
uid = geteuid();
#ifdef INET6
- log(LOG_DEBUG, "%s (with IPv6) started (uid %d with %d descriptors)",
+ mylog(LOG_DEBUG, "%s (with IPv6) started (uid %d with %d descriptors)",
version, uid, cnf.sd_max);
#else
- log(LOG_DEBUG, "%s started (uid %d with %d descriptors)",
+ mylog(LOG_DEBUG, "%s started (uid %d with %d descriptors)",
version, uid, cnf.sd_max);
#endif
#else
#ifdef INET6
- log(LOG_DEBUG, "%s (with IPv6) started (with %d descriptors)",
+ mylog(LOG_DEBUG, "%s (with IPv6) started (with %d descriptors)",
version, cnf.sd_max);
#else
- log(LOG_DEBUG, "%s started (with %d descriptors)",
+ mylog(LOG_DEBUG, "%s started (with %d descriptors)",
version, cnf.sd_max);
#endif
#endif
@@ -551,7 +557,7 @@
}
}
if (strchr(myname, '.') == NULL)
- log(LOG_INFO, "hostname (%s) is not a FQDN", myname);
+ mylog(LOG_INFO, "hostname (%s) is not a FQDN", myname);
}
if (addmyalias(myname) < 0)
{
@@ -559,13 +565,13 @@
}
if (cnf.fallbackmx != NULL && isamyalias(cnf.fallbackmx))
{
- log(LOG_INFO, "ignoring fallbackmx (%s)", cnf.fallbackmx);
+ mylog(LOG_INFO, "ignoring fallbackmx (%s)", cnf.fallbackmx);
free(cnf.fallbackmx);
cnf.fallbackmx = NULL;
}
if (cnf.pgateway != NULL && isamyalias(cnf.pgateway))
{
- log(LOG_INFO, "ignoring protocol gateway (%s)", cnf.pgateway);
+ mylog(LOG_INFO, "ignoring protocol gateway (%s)", cnf.pgateway);
free(cnf.pgateway);
cnf.pgateway = NULL;
}
@@ -574,7 +580,7 @@
{
if(rcpts_def_load() < 0)
{
- log(LOG_INFO, "ignoring R option (%s)", cnf.rcpts_def);
+ mylog(LOG_INFO, "ignoring R option (%s)", cnf.rcpts_def);
free(cnf.rcpts_def);
cnf.rcpts_def = NULL;
}