sendmail-8.12.11
中治@豊橋です。
ccでコンパイルできたのでパッチです。union wait の取扱はこれでよいのかなぁ。
atexit() 対策のため、GNU libiberty の xatexit() を使うようにしました。
手元では、devtools/Site/site.config.m4 を
define(`confSM_OS_HEADER', `sm_os_news')
APPENDDEF(`confLDOPTS', `-L/usr/GNU/lib')
APPENDDEF(`confLIBS', `-liberty')
APPENDDEF(`confOPTIMIZE', `-Olimit 2000')
としてコンパイルできることを確認しましたが、こういうのがうれしい人って残っ
てますか?
--
NAKAJI Hiroyuki (中治 弘行)
^L
Index: devtools/OS/NEWS-OS.4.x
===================================================================
RCS file: /export2/src/cvs/sendmail/devtools/OS/NEWS-OS.4.x,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 NEWS-OS.4.x
--- devtools/OS/NEWS-OS.4.x 18 May 2004 05:43:42 -0000 1.1.1.1
+++ devtools/OS/NEWS-OS.4.x 18 May 2004 07:14:31 -0000
@@ -3,14 +3,9 @@
dnl DO NOT EDIT THIS FILE.
dnl Place personal settings in devtools/Site/site.config.m4
-define(`confBEFORE', `limits.h')
define(`confMAPDEF', `-DNDBM')
define(`confLIBS', `-lmld')
define(`confMBINDIR', `/usr/lib')
define(`confSBINDIR', `/usr/etc')
define(`confUBINDIR', `/usr/ucb')
define(`confEBINDIR', `/usr/lib')
-PUSHDIVERT(3)
-limits.h:
- touch limits.h
-POPDIVERT
Index: include/sm/conf.h
===================================================================
RCS file: /export2/src/cvs/sendmail/include/sm/conf.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 conf.h
--- include/sm/conf.h 18 May 2004 05:44:07 -0000 1.1.1.1
+++ include/sm/conf.h 18 May 2004 09:46:32 -0000
@@ -1980,6 +1980,9 @@
# ifndef BSD
# define BSD /* has BSD routines */
# endif /* ! BSD */
+# ifndef BSD4_3
+# define BSD4_3
+# endif /* ! BSD4_3 */
# define HASUNSETENV 1 /* has unsetenv(2) call */
# undef HASSETVBUF /* don't actually have setvbuf(3) */
# define WAITUNION 1 /* use "union wait" as wait argument type */
@@ -1989,14 +1992,23 @@
# define HASFLOCK 1 /* has flock(2) call */
# endif /* ! HASFLOCK */
# define setpgid setpgrp
-# undef WIFEXITED
-# undef WEXITSTATUS
+# define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode)
+# define WCOREDUMP(s) ((s).w_stopval != WSTOPPED && (s).w_coredump != 0)
+# define WTERMSIG(s) WIFSIGNALED(s)
# define MODE_T int /* system include files have no mode_t */
typedef int pid_t;
typedef int (*sigfunc_t)();
# define SIGFUNC_DEFINED
# define SIGFUNC_RETURN (0)
# define SIGFUNC_DECL int
+# define SM_ALIGN_SIZE (sizeof(long))
+# define SM_INT32 int /* 32bit integer */
+# ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+# endif
+# include <limits.h>
+# define atexit(f) xatexit((f)) /* xatexit() is in libiberty.a */
+# define SM_CONF_SYSLOG 0
# else /* ! __svr4 */
/* NEWS-OS 6.0.3 with /bin/cc */
Index: include/sm/os/sm_os_news.h
===================================================================
RCS file: include/sm/os/sm_os_news.h
diff -N include/sm/os/sm_os_news.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ include/sm/os/sm_os_news.h 18 May 2004 06:50:22 -0000
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ *
+ * $Id: sm_os_next.h,v 1.1.1.1 2004/05/18 05:44:10 nakaji Exp $
+ */
+
+/*
+** Platform definitions for NEWS-OS
+*/
+
+#define SM_OS_NAME "news"
+
+#define SM_CONF_SIGSETJMP 0
+#define SM_CONF_SSIZE_T 0
+#define SM_CONF_FORMAT_TEST 0
+
+/* doesn't seem to work on NeXT 3.x */
+/* #define SM_DEAD(proto) proto */
+/* #define SM_UNUSED(decl) decl */
+
+/* try LLONG tests in libsm/t-types.c? */
+#ifndef SM_CONF_TEST_LLONG
+# define SM_CONF_TEST_LLONG 0
+#endif /* !SM_CONF_TEST_LLONG */
Index: sendmail/collect.c
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/collect.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 collect.c
--- sendmail/collect.c 18 May 2004 05:43:53 -0000 1.1.1.1
+++ sendmail/collect.c 18 May 2004 08:12:54 -0000
@@ -465,8 +465,7 @@
OpMode != MD_DAEMON &&
OpMode != MD_ARPAFTP)
{
- SM_ASSERT(pbp < peekbuf +
- sizeof(peekbuf));
+ SM_ASSERT(pbp < peekbuf + sizeof(peekbuf));
*pbp++ = '\r';
c = '.';
}
Index: sendmail/conf.c
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/conf.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 conf.c
--- sendmail/conf.c 18 May 2004 05:43:53 -0000 1.1.1.1
+++ sendmail/conf.c 18 May 2004 08:50:29 -0000
@@ -2625,11 +2625,19 @@
** none.
*/
+#ifdef WAITUNION
+union wait
+#else
int
+#endif
waitfor(pid)
pid_t pid;
{
+#ifdef WAITUNION
+ union wait st;
+#else
int st;
+#endif
pid_t i;
do
@@ -2640,7 +2648,11 @@
proc_list_drop(i, st, NULL);
} while ((i >= 0 || errno == EINTR) && i != pid);
if (i < 0)
+#ifdef WAITUNION
+ st.w_status = -1;
+#else
return -1;
+#endif
return st;
}
/*
Index: sendmail/deliver.c
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/deliver.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 deliver.c
--- sendmail/deliver.c 18 May 2004 05:43:55 -0000 1.1.1.1
+++ sendmail/deliver.c 18 May 2004 08:57:49 -0000
@@ -3749,7 +3749,11 @@
register ENVELOPE *e;
char **pv;
{
+#ifdef WAITUNION
+ union wait st;
+#else
int st;
+#endif
int save_errno = errno;
char buf[MAXLINE];
SM_EVENT *ev = NULL;
@@ -3818,7 +3822,11 @@
sm_clrevent(ev);
errno = save_errno;
+#ifdef WAITUNION
+ if (st.w_status == -1)
+#else
if (st == -1)
+#endif
{
syserr("endmailer %s: wait", mci->mci_mailer->m_name);
return EX_SOFTWARE;
@@ -4725,8 +4733,7 @@
pos += bp - buf;
if (c != '\r')
{
- SM_ASSERT(pbp < peekbuf +
- sizeof(peekbuf));
+ SM_ASSERT(pbp < peekbuf + sizeof(peekbuf));
*pbp++ = c;
}
}
@@ -4798,8 +4805,7 @@
SM_TIME_DEFAULT))
!= SM_IO_EOF)
{
- SM_ASSERT(pbp < peekbuf +
- sizeof(peekbuf));
+ SM_ASSERT(pbp < peekbuf + sizeof(peekbuf));
*pbp++ = d;
}
@@ -4851,8 +4857,7 @@
mci->mci_mailer->m_eol);
}
ostate = OS_HEAD;
- SM_ASSERT(pbp < peekbuf +
- sizeof(peekbuf));
+ SM_ASSERT(pbp < peekbuf + sizeof(peekbuf));
*pbp++ = c;
continue;
}
@@ -5536,10 +5541,18 @@
else
{
/* parent -- wait for exit status */
+#ifdef WAITUNION
+ union wait st;
+#else
int st;
+#endif
st = waitfor(pid);
+#ifdef WAITUNION
+ if (st.w_status == -1)
+#else
if (st == -1)
+#endif
{
syserr("mailfile: %s: wait", mailer->m_name);
return EX_SOFTWARE;
Index: sendmail/main.c
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/main.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 main.c
--- sendmail/main.c 18 May 2004 05:43:57 -0000 1.1.1.1
+++ sendmail/main.c 18 May 2004 08:10:26 -0000
@@ -2231,7 +2231,11 @@
(void) sm_signal(SIGCHLD, SIG_DFL);
while (CurChildren > 0)
{
+#ifdef WAITUNION
+ union wait status;
+#else
int status;
+#endif
pid_t ret;
errno = 0;
@@ -2390,7 +2394,11 @@
(void) sm_signal(SIGCHLD, SIG_DFL);
while (CurChildren > 0)
{
+#ifdef WAITUNION
+ union wait status;
+#else
int status;
+#endif
pid_t ret;
int group;
Index: sendmail/map.c
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/map.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 map.c
--- sendmail/map.c 18 May 2004 05:43:57 -0000 1.1.1.1
+++ sendmail/map.c 18 May 2004 09:03:28 -0000
@@ -6363,7 +6363,11 @@
int i;
int save_errno;
int fd;
+#ifdef WAITUNION
+ union wait status;
+#else
int status;
+#endif
auto pid_t pid;
register char *p;
char *rval;
@@ -6448,7 +6452,11 @@
(void) sm_releasesignal(SIGCHLD);
errno = save_errno;
+#ifdef WAITUNION
+ if (status.w_status == -1)
+#else
if (status == -1)
+#endif
{
syserr("prog_map_lookup(%s): wait error %s",
map->map_mname, sm_errstring(errno));
Index: sendmail/sendmail.h
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/sendmail.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sendmail.h
--- sendmail/sendmail.h 18 May 2004 05:44:01 -0000 1.1.1.1
+++ sendmail/sendmail.h 18 May 2004 08:42:57 -0000
@@ -2582,7 +2582,11 @@
extern bool usershellok __P((char *, char *));
extern void vendor_post_defaults __P((ENVELOPE *));
extern void vendor_pre_defaults __P((ENVELOPE *));
+#ifdef WAITUNION
+extern union wait waitfor __P((pid_t));
+#else
extern int waitfor __P((pid_t));
+#endif
extern bool writable __P((char *, ADDRESS *, long));
#if SM_HEAP_CHECK
# define xalloc(size) xalloc_tagged(size, __FILE__, __LINE__)
Index: sendmail/util.c
===================================================================
RCS file: /export2/src/cvs/sendmail/sendmail/util.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 util.c
--- sendmail/util.c 18 May 2004 05:44:05 -0000 1.1.1.1
+++ sendmail/util.c 18 May 2004 09:10:32 -0000
@@ -2595,7 +2595,11 @@
void
proc_list_drop(pid, st, other)
pid_t pid;
+#ifdef WAITUNION
+ union wait st;
+#else
int st;
+#endif
int *other;
{
int i;
Index: vacation/vacation.c
===================================================================
RCS file: /export2/src/cvs/sendmail/vacation/vacation.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 vacation.c
--- vacation/vacation.c 18 May 2004 05:44:54 -0000 1.1.1.1
+++ vacation/vacation.c 18 May 2004 09:39:23 -0000
@@ -79,11 +79,11 @@
char From[MAXLINE];
-#if defined(__hpux) || defined(__osf__)
+#if defined(__hpux) || defined(__osf__) || defined(__sony_news__)
# ifndef SM_CONF_SYSLOG_INT
# define SM_CONF_SYSLOG_INT 1
# endif /* SM_CONF_SYSLOG_INT */
-#endif /* defined(__hpux) || defined(__osf__) */
+#endif /* defined(__hpux) || defined(__osf__) || defined(__sony_news__) */
#if SM_CONF_SYSLOG_INT
# define SYSLOG_RET_T int
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735