summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/sys/osdep.c79
-rw-r--r--include/osdep.h28
-rw-r--r--mbbsd/chess.c4
-rw-r--r--mbbsd/mbbsd.c11
-rw-r--r--mbbsd/talk.c12
-rw-r--r--pttbbs.mk5
-rw-r--r--util/bbsrf.c24
-rw-r--r--util/reaper.c4
8 files changed, 8 insertions, 159 deletions
diff --git a/common/sys/osdep.c b/common/sys/osdep.c
index cd2e1d3e..434ca583 100644
--- a/common/sys/osdep.c
+++ b/common/sys/osdep.c
@@ -180,24 +180,6 @@ size_t strlcpy(dst, src, siz)
#endif
-#ifdef NEED_BSD_SIGNAL
-
-void (*bsd_signal(int sig, void (*func)(int)))(int)
-{
- struct sigaction act, oact;
-
- act.sa_handler = func;
- act.sa_flags = SA_RESTART;
- sigemptyset(&act.sa_mask);
- sigaddset(&act.sa_mask, sig);
- if (sigaction(sig, &act, &oact) == -1)
- return(SIG_ERR);
- return(oact.sa_handler);
-}
-
-
-#endif
-
#ifdef HAVE_SETPROCTITLE
void
@@ -291,67 +273,6 @@ cpuload(char *str)
#endif
-#ifdef Solaris
-
-#include <kstat.h>
-#include <sys/param.h>
-
-#define loaddouble(la) ((double)(la) / FSCALE)
-
-int
-cpuload(char *str)
-{
- kstat_ctl_t *kc;
- kstat_t *ks;
- kstat_named_t *kn;
- double l[3] = {-1, -1, -1};
-
- kc = kstat_open();
-
- if( !kc ){
- strcpy(str, "(unknown) ");
- return -1;
- }
-
- ks = kstat_lookup( kc, "unix", 0, "system_misc");
-
- if( kstat_read( kc, ks, 0) == -1){
- strcpy( str, "( unknown ");
- return -1;
- }
-
- kn = kstat_data_lookup( ks, "avenrun_1min" );
-
- if( kn ) {
- l[0] = loaddouble(kn->value.ui32);
- }
-
- kn = kstat_data_lookup( ks, "avenrun_5min" );
-
- if( kn ) {
- l[1] = loaddouble(kn->value.ui32);
- }
-
- kn = kstat_data_lookup( ks, "avenrun_15min" );
-
- if( kn ) {
- l[2] = loaddouble(kn->value.ui32);
- }
-
- if (str) {
-
- if (l[0] != -1)
- sprintf(str, " %.2f %.2f %.2f", l[0], l[1], l[2]);
- else
- strcpy(str, " (unknown) ");
- }
-
- kstat_close(kc);
- return (int)l[0];
-}
-
-#endif
-
#ifdef __linux__
int
cpuload(char *str)
diff --git a/include/osdep.h b/include/osdep.h
index 89cb1edb..17462069 100644
--- a/include/osdep.h
+++ b/include/osdep.h
@@ -26,28 +26,6 @@
#define NEED_STRLCPY
#define NEED_STRLCAT
-#elif defined(Solaris)
-
- #include <alloca.h>
- #include <crypt.h>
- #include <sys/param.h>
- #include <sys/ioctl.h>
- #include <limits.h>
- #include <strings.h> /* for strcasecmp() */
-
- #define _ISOC99_SOURCE
-
- #define NEED_TIMEGM
-
- #if __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 8
- #define NEED_STRLCPY
- #define NEED_STRLCAT
- #endif
-
- #if __OS_MAJOR_VERSION__ == 5 && __OS_MAJOR_VERSION__ < 6
- #define NEED_BSD_SIGNAL
- #endif
-
#else
#error "Unknown OSTYPE"
@@ -55,11 +33,7 @@
#endif
-#ifdef Solaris
- #define Signal (bsd_signal)
-#else
- #define Signal (signal)
-#endif
+#define Signal (signal)
#ifdef NEED_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t size);
diff --git a/mbbsd/chess.c b/mbbsd/chess.c
index a86ca766..081b812f 100644
--- a/mbbsd/chess.c
+++ b/mbbsd/chess.c
@@ -1250,11 +1250,7 @@ ChessWatchGame(void (*play)(int, ChessGameMode), int game, const char* title)
vmsg("無法建立連線");
return -1;
}
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- msgsock = accept(sock, (struct sockaddr *) 0, 0);
-#else
msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0);
-#endif
close(sock);
if (msgsock < 0)
return -1;
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index b112b821..a45c2705 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1712,15 +1712,8 @@ daemon_login(int argc, char *argv[], char *envp[])
/* main loop */
while( 1 ){
len_of_sock_addr = sizeof(xsin);
- if(
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- (csock = accept(msock, (struct sockaddr *)&xsin,
- &len_of_sock_addr)) < 0
-#else
- (csock = accept(msock, (struct sockaddr *)&xsin,
- (socklen_t *)&len_of_sock_addr)) < 0
-#endif
- ) {
+ if ( (csock = accept(msock, (struct sockaddr *)&xsin,
+ (socklen_t *)&len_of_sock_addr)) < 0 ) {
if (errno != EINTR)
sleep(1);
continue;
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 199bd639..ea694467 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1543,11 +1543,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){
return -1;
}
length = sizeof(server);
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- if (getsockname(sock, (struct sockaddr *) & server, & length) < 0) {
-#else
if (getsockname(sock, (struct sockaddr *) & server, (socklen_t *) & length) < 0) {
-#endif
close(sock);
perror("sock name err");
unlockutmpmode();
@@ -1647,11 +1643,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
if (sock < 0)
vmsg("無法建立連線");
else {
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- msgsock = accept(sock, (struct sockaddr *) 0, 0);
-#else
msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0);
-#endif
if (msgsock == -1) {
perror("accept");
close(sock);
@@ -1784,11 +1776,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
return;
}
-#if defined(Solaris) && __OS_MAJOR_VERSION__ == 5 && __OS_MINOR_VERSION__ < 7
- msgsock = accept(sock, (struct sockaddr *) 0, 0);
-#else
msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0);
-#endif
if (msgsock == -1) {
perror("accept");
close(sock);
diff --git a/pttbbs.mk b/pttbbs.mk
index 79c21177..5da43f75 100644
--- a/pttbbs.mk
+++ b/pttbbs.mk
@@ -29,11 +29,6 @@ CFLAGS_Linux=
LDFLAGS_Linux=
LIBS_Linux=
-# SunOS特有的環境
-CFLAGS_Solaris= -DSolaris -I/usr/local/include
-LDFLAGS_Solaris= -L/usr/local/lib -L/usr/lib
-LIBS_Solaris= -lnsl -lsocket -liconv -lkstat
-
OS_FLAGS= -D__OS_MAJOR_VERSION__="$(OS_MAJOR_VER)" \
-D__OS_MINOR_VERSION__="$(OS_MINOR_VER)"
diff --git a/util/bbsrf.c b/util/bbsrf.c
index a2ca235c..25b108fe 100644
--- a/util/bbsrf.c
+++ b/util/bbsrf.c
@@ -13,27 +13,17 @@
#include <sys/uio.h>
#include "config.h"
-#ifdef Solaris
- #include <utmpx.h>
- #define U_FILE UTMPX_FILE
-#else
- #include <utmp.h>
- #define U_FILE UTMP_FILE
-#endif
+#include <utmp.h>
+#define U_FILE UTMP_FILE
#ifdef __FreeBSD__
#define UTMP_FILE _PATH_UTMP
#endif
-#ifndef Solaris
- #if MAXHOSTNAMELEN < UT_HOSTSIZE
- #define MAX_HOMENAME_LEN MAXHOSTNAMELEN
- #else
- #define MAX_HOMENAME_LEN UT_HOSTSIZE
- #endif
+#if MAXHOSTNAMELEN < UT_HOSTSIZE
+ #define MAX_HOMENAME_LEN MAXHOSTNAMELEN
#else
- /* according to /usr/include/utmpx.h ... */
- #define MAX_HOMENAME_LEN 256
+ #define MAX_HOMENAME_LEN UT_HOSTSIZE
#endif
/* fill the hid with from hostname */
@@ -80,11 +70,7 @@ int main(void)
int uid, rtv = 0;
char *tty, ttybuf[32], hid[MAX_HOMENAME_LEN + 1];
-#ifndef Solaris
openlog("bbsrf", LOG_PID | LOG_PERROR, LOG_USER);
-#else
- openlog("bbsrf", LOG_PID, LOG_USER);
-#endif
chdir(BBSHOME);
uid = getuid();
diff --git a/util/reaper.c b/util/reaper.c
index a5218706..d89f6e56 100644
--- a/util/reaper.c
+++ b/util/reaper.c
@@ -165,11 +165,7 @@ int check_last_login(void *data, int n, userec_t *u) {
int main(int argc, char **argv)
{
now = time(NULL);
-#ifdef Solaris
- openlog("reaper", LOG_PID, SYSLOG_FACILITY);
-#else
openlog("reaper", LOG_PID | LOG_PERROR, SYSLOG_FACILITY);
-#endif
chdir(BBSHOME);
attach_SHM();