sj3serv: Migrate to KNF and ISO C all but setup.c

Signed-off-by: Masanori Ogino <mogino@acm.org>
This commit is contained in:
Masanori Ogino 2023-11-29 11:46:20 +09:00
commit 55d33df2a1
6 changed files with 1156 additions and 1147 deletions

View file

@ -28,34 +28,24 @@
* from Sony Corporation. * from Sony Corporation.
*/ */
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "sj_sysvdef.h" #include "sj_sysvdef.h"
#include "sj_kcnv.h"
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <setjmp.h> #include <setjmp.h>
#include <errno.h> #include <signal.h>
#ifdef SVR4 #include <stdlib.h>
#include <sys/filio.h> #include <string.h>
#include <sys/signal.h> #include <unistd.h>
#include <poll.h>
#endif #include "sj_kcnv.h"
#ifdef TLI
#include <fcntl.h>
#include <tiuser.h>
#include <stropts.h>
#include <sys/types.h>
#include <netdir.h>
#include <netconfig.h>
#endif
#ifdef SVR4 #ifdef SVR4
#define signal sigset #define signal sigset
@ -72,45 +62,44 @@
# define SOMAXCONN 5 # define SOMAXCONN 5
#endif #endif
int client_num = 0; int client_num = 0;
Client *client = NULL; Client *client = NULL;
Client *cur_client; Client *cur_client;
int maxfds = 0; int maxfds = 0;
#ifdef SVR4 #ifdef SVR4
struct pollfd poll_fds[_NFILE]; struct pollfd poll_fds[_NFILE];
#else #else
fd_set fds_org = { 0 }; fd_set fds_org = { 0 };
#endif #endif
jmp_buf client_dead; jmp_buf client_dead;
int client_fd; int client_fd;
extern char *socket_name; extern char *socket_name;
extern char *port_name; extern char *port_name;
#ifdef TLI #ifdef TLI
extern char *port_number; extern char *port_number;
extern char *proto_name; extern char *proto_name;
#else #else
extern int port_number; extern int port_number;
#endif #endif
extern int max_client; extern int max_client;
static int fd_inet = -1; static int fd_inet = -1;
static int fd_unix = -1; static int fd_unix = -1;
static char putbuf[BUFSIZ];
static char getbuf[BUFSIZ];
static int putpos = 0;
static int buflen = 0;
static int getpos = 0;
static char putbuf[BUFSIZ];
static char getbuf[BUFSIZ];
static int putpos = 0;
static int buflen = 0;
static int getpos = 0;
void void
socket_init(void) socket_init(void)
{ {
#ifdef SVR4 #ifdef SVR4
int i; int i;
for (i = 0; i < _NFILE; i++) { for (i = 0; i < _NFILE; i++) {
poll_fds[i].fd = -1; poll_fds[i].fd = -1;
poll_fds[i].events = 0; poll_fds[i].events = 0;
@ -123,23 +112,20 @@ socket_init(void)
maxfds = 0; maxfds = 0;
} }
static void static void
set_fd(int fd) set_fd(int fd)
{ {
#ifdef SVR4 #ifdef SVR4
poll_fds[maxfds].fd = fd; poll_fds[maxfds].fd = fd;
poll_fds[maxfds].events = POLLIN; poll_fds[maxfds].events = POLLIN;
maxfds++; maxfds++;
#else #else
FD_SET(fd, &fds_org); FD_SET(fd, &fds_org);
if (fd >= maxfds) maxfds = fd + 1; if (fd >= maxfds)
maxfds = fd + 1;
#endif #endif
} }
static void static void
clr_fd(int fd) clr_fd(int fd)
{ {
@ -150,9 +136,9 @@ clr_fd(int fd)
if (poll_fds[i].fd == fd) { if (poll_fds[i].fd == fd) {
maxfds--; maxfds--;
for (j = i; j < maxfds; j++) { for (j = i; j < maxfds; j++) {
poll_fds[j].fd = poll_fds[j+1].fd; poll_fds[j].fd = poll_fds[j + 1].fd;
poll_fds[j].events = poll_fds[j+1].events; poll_fds[j].events = poll_fds[j + 1].events;
poll_fds[j].revents = poll_fds[j+1].revents; poll_fds[j].revents = poll_fds[j + 1].revents;
} }
poll_fds[j].fd = -1; poll_fds[j].fd = -1;
poll_fds[j].events = 0; poll_fds[j].events = 0;
@ -164,7 +150,8 @@ clr_fd(int fd)
FD_CLR(fd, &fds_org); FD_CLR(fd, &fds_org);
if (maxfds == fd + 1) { if (maxfds == fd + 1) {
while (--fd >= 0) { while (--fd >= 0) {
if (FD_ISSET(fd, &fds_org)) break; if (FD_ISSET(fd, &fds_org))
break;
} }
maxfds = fd + 1; maxfds = fd + 1;
} }
@ -173,7 +160,6 @@ clr_fd(int fd)
#if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX))) #if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX)))
static void static void
open_af_unix(void) open_af_unix(void)
{ {
@ -191,12 +177,14 @@ open_af_unix(void)
exit(1); exit(1);
} }
if (bind(fd_unix, (struct sockaddr *)&sunix, strlen(sunix.sun_path) + 2) == ERROR) { if (bind(fd_unix, (struct sockaddr *)&sunix,
if (errno == EADDRINUSE) strlen(sunix.sun_path) + 2) == ERROR) {
if (errno == EADDRINUSE) {
fprintf(stderr, "Port '%s' is already in use\n", fprintf(stderr, "Port '%s' is already in use\n",
socket_name); socket_name);
else } else {
fprintf(stderr, "Can't bind AF_UNIX socket\n"); fprintf(stderr, "Can't bind AF_UNIX socket\n");
}
shutdown(fd_unix, 2); shutdown(fd_unix, 2);
close(fd_unix); close(fd_unix);
unlink(socket_name); unlink(socket_name);
@ -219,128 +207,131 @@ struct t_call *inet_callptr;
struct netconfig *nconf; struct netconfig *nconf;
#endif #endif
static void static void
open_af_inet(void) open_af_inet(void)
{ {
#ifdef TLI #ifdef TLI
struct t_bind *req; struct t_bind *req;
struct nd_hostserv hserv; struct nd_hostserv hserv;
struct nd_addrlist *addrs; struct nd_addrlist *addrs;
struct t_optmgmt *opt; struct t_optmgmt *opt;
struct opthdr *hdr; struct opthdr *hdr;
void *handlep; void *handlep;
extern int t_errno; extern int t_errno;
extern void *setnetpath(); extern void *setnetpath();
extern struct netconfig *getnetpath(); extern struct netconfig *getnetpath();
#else #else
struct sockaddr_in sin; struct sockaddr_in sin;
struct servent *sp; struct servent *sp;
u_short port; u_short port;
#endif #endif
int true = 1; int true = 1;
#ifdef TLI #ifdef TLI
if (( handlep = setnetpath()) == NULL) { if ((handlep = setnetpath()) == NULL) {
fprintf(stderr, "Setnetpath fail\n"); fprintf(stderr, "Setnetpath fail\n");
exit(1); exit(1);
} }
while((nconf = getnetpath(handlep)) != NULL) { while ((nconf = getnetpath(handlep)) != NULL) {
if ((nconf->nc_semantics == NC_TPI_COTS_ORD) && if ((nconf->nc_semantics == NC_TPI_COTS_ORD) &&
(strncmp(nconf->nc_proto, proto_name, strlen(proto_name)) == 0)) (strncmp(nconf->nc_proto, proto_name, strlen(proto_name)) ==
break; 0))
break;
} }
if (nconf == NULL) { if (nconf == NULL) {
fprintf(stderr, "No connection mode transport\n"); fprintf(stderr, "No connection mode transport\n");
exit(1); exit(1);
} }
hserv.h_host = HOST_SELF; hserv.h_host = HOST_SELF;
hserv.h_serv = port_number; hserv.h_serv = port_number;
if (netdir_getbyname(nconf, &hserv, &addrs) != 0) { if (netdir_getbyname(nconf, &hserv, &addrs) != 0) {
hserv.h_serv = port_name; hserv.h_serv = port_name;
if (netdir_getbyname(nconf, &hserv, &addrs) != 0) { if (netdir_getbyname(nconf, &hserv, &addrs) != 0) {
fprintf(stderr, "Can't get address\n"); fprintf(stderr, "Can't get address\n");
exit(1); exit(1);
} }
} }
if ((fd_inet = t_open(nconf->nc_device, O_RDWR, (struct t_info *) NULL)) < 0) { if ((fd_inet = t_open(nconf->nc_device, O_RDWR,
fprintf(stderr,"Can't t_open\n"); (struct t_info *)NULL)) < 0) {
exit(1); fprintf(stderr, "Can't t_open\n");
exit(1);
} }
if ((opt = (struct t_optmgmt *) t_alloc(fd_inet, T_OPTMGMT, T_ALL)) == NULL) { if ((opt = (struct t_optmgmt *)t_alloc(fd_inet, T_OPTMGMT, T_ALL)) ==
NULL) {
fprintf(stderr, "Can't t_alloc error for T_OPTMGT\n"); fprintf(stderr, "Can't t_alloc error for T_OPTMGT\n");
exit(1); exit(1);
} }
if ((hdr = (struct opthdr *) malloc(sizeof(*hdr) + sizeof(true))) == NULL) { if ((hdr = (struct opthdr *)malloc(sizeof(*hdr) + sizeof(true))) ==
NULL) {
fprintf(stderr, "server: not malloc\n"); fprintf(stderr, "server: not malloc\n");
exit(1); exit(1);
} }
hdr->level = SOL_SOCKET; hdr->level = SOL_SOCKET;
hdr->name = SO_REUSEADDR; hdr->name = SO_REUSEADDR;
hdr->len = sizeof(true); hdr->len = sizeof(true);
(void) memcpy(&true, (char *)hdr + sizeof(*hdr), sizeof(true));
opt->opt.len = opt->opt.maxlen = sizeof(*hdr) + sizeof(true); (void)memcpy(&true, (char *)hdr + sizeof(*hdr), sizeof(true));
opt->flags = T_CHECK;
opt->opt.buf = (char *)hdr;
if ((t_optmgmt(fd_inet, opt, opt) < 0) || !(opt->flags & T_SUCCESS)){ opt->opt.len = opt->opt.maxlen = sizeof(*hdr) + sizeof(true);
opt->flags = T_CHECK;
opt->opt.buf = (char *)hdr;
if ((t_optmgmt(fd_inet, opt, opt) < 0) || !(opt->flags & T_SUCCESS)) {
fprintf(stderr, "Warning: Can't reuse address %s(%s)\n", fprintf(stderr, "Warning: Can't reuse address %s(%s)\n",
port_name, port_number); port_name, port_number);
} else { } else {
opt->flags = T_NEGOTIATE; opt->flags = T_NEGOTIATE;
(void) memcpy(&true, (char *)hdr + sizeof(*hdr), sizeof(true)); (void)memcpy(&true, (char *)hdr + sizeof(*hdr), sizeof(true));
(void) t_optmgmt(fd_inet, opt, opt); (void)t_optmgmt(fd_inet, opt, opt);
} }
if ((req = (struct t_bind *) t_alloc(fd_inet, T_BIND, T_ALL)) == NULL) { if ((req = (struct t_bind *)t_alloc(fd_inet, T_BIND, T_ALL)) == NULL) {
t_close(fd_inet); t_close(fd_inet);
fprintf(stderr, "Can't alloc bind data\n"); fprintf(stderr, "Can't alloc bind data\n");
exit(1); exit(1);
} }
req->addr.maxlen = addrs->n_addrs->maxlen; req->addr.maxlen = addrs->n_addrs->maxlen;
req->addr.len = addrs->n_addrs->len; req->addr.len = addrs->n_addrs->len;
(void) memcpy(addrs->n_addrs->buf, req->addr.buf, addrs->n_addrs->len); (void)memcpy(addrs->n_addrs->buf, req->addr.buf, addrs->n_addrs->len);
req->qlen = 5; req->qlen = 5;
if (t_bind(fd_inet, req, req) < 0 ) { if (t_bind(fd_inet, req, req) < 0) {
fprintf(stderr, "Can't t_bind\n"); fprintf(stderr, "Can't t_bind\n");
t_close(fd_inet); t_close(fd_inet);
exit(1); exit(1);
} }
if (memcmp(req->addr.buf, addrs->n_addrs->buf, addrs->n_addrs->len) != 0) { if (memcmp(req->addr.buf, addrs->n_addrs->buf, addrs->n_addrs->len) !=
fprintf(stderr, "Port '%s(%s)' is already in use\n", 0) {
port_name, port_number); fprintf(stderr, "Port '%s(%s)' is already in use\n",
t_close(fd_inet); port_name, port_number);
exit(1); t_close(fd_inet);
exit(1);
} }
if ((inet_callptr = (struct t_call *) t_alloc(fd_inet, T_CALL, T_ALL)) == NULL) { if ((inet_callptr = (struct t_call *)t_alloc(fd_inet, T_CALL, T_ALL)) ==
fprintf(stderr,"t_alloc error for T_CALL\n"); NULL) {
t_close(fd_inet); fprintf(stderr, "t_alloc error for T_CALL\n");
exit(1); t_close(fd_inet);
exit(1);
} }
inet_callptr->addr = *(addrs->n_addrs); inet_callptr->addr = *(addrs->n_addrs);
inet_callptr->udata.maxlen = 0; inet_callptr->udata.maxlen = 0;
inet_callptr->udata.len = 0; inet_callptr->udata.len = 0;
inet_callptr->udata.buf = (char *) NULL; inet_callptr->udata.buf = (char *)NULL;
#else #else
if ((sp = getservbyname(port_name, "tcp")) != NULL) if ((sp = getservbyname(port_name, "tcp")) != NULL)
port = ntohs(sp -> s_port); port = ntohs(sp->s_port);
else else
port = port_number; port = port_number;
memset((char *)&sin, '\0', sizeof(sin)); memset((char *)&sin, '\0', sizeof(sin));
sin.sin_family = AF_INET; sin.sin_family = AF_INET;
sin.sin_port = htons(port); sin.sin_port = htons(port);
sin.sin_addr.s_addr = htonl(INADDR_ANY); sin.sin_addr.s_addr = htonl(INADDR_ANY);
if ((fd_inet = socket(AF_INET, SOCK_STREAM, 0)) == ERROR) { if ((fd_inet = socket(AF_INET, SOCK_STREAM, 0)) == ERROR) {
@ -352,17 +343,18 @@ open_af_inet(void)
if (bind(fd_inet, (struct sockaddr *)&sin, sizeof(sin)) == ERROR) { if (bind(fd_inet, (struct sockaddr *)&sin, sizeof(sin)) == ERROR) {
if (errno == EADDRINUSE) { if (errno == EADDRINUSE) {
if (sp) if (sp) {
fprintf(stderr, fprintf(stderr,
"Port '%s(%d)' is already in use\n", "Port '%s(%d)' is already in use\n",
port_name, port); port_name, port);
else } else {
fprintf(stderr, fprintf(stderr,
"Port %d is already in use\n", "Port %d is already in use\n",
port); port);
} }
else } else {
fprintf(stderr, "Can't bind AF_INET socket\n"); fprintf(stderr, "Can't bind AF_INET socket\n");
}
shutdown(fd_inet, 2); shutdown(fd_inet, 2);
close(fd_inet); close(fd_inet);
exit(1); exit(1);
@ -389,13 +381,12 @@ open_socket(void)
#if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX))) #if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX)))
static int static int
connect_af_unix(void) connect_af_unix(void)
{ {
struct sockaddr_un sunix; struct sockaddr_un sunix;
int i = sizeof(sunix); int i = sizeof(sunix);
int fd; int fd;
if ((fd = accept(fd_unix, (struct sockaddr *)&sunix, &i)) == ERROR) if ((fd = accept(fd_unix, (struct sockaddr *)&sunix, &i)) == ERROR)
warning_out("Can't accept AF_UNIX socket"); warning_out("Can't accept AF_UNIX socket");
@ -405,56 +396,57 @@ connect_af_unix(void)
#ifdef TLI #ifdef TLI
int int
accept_func(int fd, struct t_call* callptr, char* name, int closeflg) accept_func(int fd, struct t_call *callptr, char *name, int closeflg)
{ {
int newfd; int look, newfd;
int look; extern int t_errno;
extern int t_errno;
if ((newfd = t_open(name, O_RDWR, (struct t_info *)0)) < 0) { if ((newfd = t_open(name, O_RDWR, (struct t_info *)0)) < 0) {
if (!closeflg) warning_out("Can't t_open"); if (!closeflg)
return ERROR; warning_out("Can't t_open");
return ERROR;
} }
if (t_bind(newfd, (struct t_bind *)0, (struct t_bind *)0) < 0) { if (t_bind(newfd, (struct t_bind *)0, (struct t_bind *)0) < 0) {
if (!closeflg) warning_out("t_bind error"); if (!closeflg)
return ERROR; warning_out("t_bind error");
return ERROR;
} }
t_errno = 0; t_errno = 0;
if (t_accept(fd, newfd, callptr) <0 ){ if (t_accept(fd, newfd, callptr) < 0) {
t_close(newfd); t_close(newfd);
if (!closeflg) warning_out("t_accept error"); if (!closeflg)
return ERROR; warning_out("t_accept error");
return ERROR;
} }
if (ioctl(newfd, I_POP, (char *) 0) < 0) { if (ioctl(newfd, I_POP, (char *)0) < 0) {
if (!closeflg) warning_out("I_POP timod failed"); if (!closeflg)
return ERROR; warning_out("I_POP timod failed");
return ERROR;
} }
if (ioctl(newfd, I_PUSH, "tirdwr") < 0) { if (ioctl(newfd, I_PUSH, "tirdwr") < 0) {
if (!closeflg) warning_out("I_PUSH tirdwr failed"); if (!closeflg)
return ERROR; warning_out("I_PUSH tirdwr failed");
return ERROR;
} }
return(newfd); return (newfd);
} }
#endif #endif
static int static int
connect_af_inet(void) connect_af_inet(void)
{ {
#ifndef TLI #ifndef TLI
struct sockaddr_in sin; struct sockaddr_in sin;
int i = sizeof(sin); int i = sizeof(sin);
#endif #endif
int fd; int fd;
#ifdef TLI #ifdef TLI
if (t_listen(fd_inet, inet_callptr) < 0) { if (t_listen(fd_inet, inet_callptr) < 0)
warning_out("t_listen error"); warning_out("t_listen error");
} if ((fd = accept_func(fd_inet, inet_callptr, nconf->nc_device,
FALSE)) == ERROR)
if ((fd = accept_func(fd_inet, inet_callptr, nconf->nc_device, FALSE)) == ERROR)
#else #else
if ((fd = accept(fd_inet, (struct sockaddr *)&sin, &i)) == ERROR) if ((fd = accept(fd_inet, (struct sockaddr *)&sin, &i)) == ERROR)
#endif #endif
@ -464,18 +456,18 @@ connect_af_inet(void)
#if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX))) #if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX)))
static void static void
close_af_unix(void) close_af_unix(void)
{ {
struct sockaddr_un sunix; struct sockaddr_un sunix;
int true = 1; int true = 1;
int i; int i;
ioctl(fd_unix, FIONBIO, &true); ioctl(fd_unix, FIONBIO, &true);
for ( ; ; ) { for (; ;) {
i = sizeof(sunix); i = sizeof(sunix);
if (accept(fd_unix, (struct sockaddr *)&sunix, &i) < 0) break; if (accept(fd_unix, (struct sockaddr *)&sunix, &i) < 0)
break;
} }
shutdown(fd_unix, 2); shutdown(fd_unix, 2);
close(fd_unix); close(fd_unix);
@ -484,8 +476,6 @@ close_af_unix(void)
} }
#endif #endif
static void static void
close_af_inet(void) close_af_inet(void)
{ {
@ -496,19 +486,21 @@ close_af_inet(void)
int i; int i;
ioctl(fd_inet, FIONBIO, &true); ioctl(fd_inet, FIONBIO, &true);
for ( ; ; ) { for (; ;) {
#ifdef TLI #ifdef TLI
if (accept_func(fd_inet, inet_callptr, nconf->nc_device, TRUE) < 0) if (accept_func(fd_inet, inet_callptr, nconf->nc_device, TRUE) <
0)
break; break;
#else #else
i = sizeof(sin); i = sizeof(sin);
if (accept(fd_inet, (struct sockaddr *)&sin, &i) < 0) break; if (accept(fd_inet, (struct sockaddr *)&sin, &i) < 0)
break;
#endif #endif
} }
#ifdef TLI #ifdef TLI
t_sndrel(fd_inet); t_sndrel(fd_inet);
t_close(fd_inet); t_close(fd_inet);
clr_fd(fd_inet); clr_fd(fd_inet);
#else #else
shutdown(fd_inet, 2); shutdown(fd_inet, 2);
close(fd_inet); close(fd_inet);
@ -525,8 +517,6 @@ close_socket(void)
close_af_inet(); close_af_inet();
} }
static void static void
#ifdef SVR4 #ifdef SVR4
connect_client(struct pollfd *readfds) connect_client(struct pollfd *readfds)
@ -536,7 +526,7 @@ connect_client(fd_set *readfds)
{ {
int fd; int fd;
#if (defined(TLI) && defined(SOCK_UNIX)) #if (defined(TLI) && defined(SOCK_UNIX))
int unix_flag=0; int unix_flag = 0;
#endif #endif
Client *client_tmp; Client *client_tmp;
@ -544,7 +534,7 @@ connect_client(fd_set *readfds)
int i; int i;
for (i = 0; i < maxfds; i++) { for (i = 0; i < maxfds; i++) {
if ((readfds[i].fd == fd_inet) && if ((readfds[i].fd == fd_inet) &&
(readfds[i].revents == POLLIN)) { (readfds[i].revents == POLLIN)) {
fd = connect_af_inet(); fd = connect_af_inet();
readfds[i].revents = 0; readfds[i].revents = 0;
@ -562,14 +552,15 @@ connect_client(fd_set *readfds)
} }
#endif #endif
} }
if (i == maxfds) return; if (i == maxfds)
return;
#else /* SVR4 */ #else /* SVR4 */
if (FD_ISSET(fd_inet, readfds)) if (FD_ISSET(fd_inet, readfds))
fd = connect_af_inet(); fd = connect_af_inet();
#if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX))) #if (!defined(TLI) || (defined(TLI) && defined(SOCK_UNIX)))
else if (FD_ISSET(fd_unix, readfds)) else if (FD_ISSET(fd_unix, readfds))
#if (defined(TLI) && defined(SOCK_UNIX)) #if (defined(TLI) && defined(SOCK_UNIX))
{ {
fd = connect_af_unix(); fd = connect_af_unix();
unix_flag = 1; unix_flag = 1;
} }
@ -580,20 +571,15 @@ connect_client(fd_set *readfds)
else else
return; return;
#endif /* SVR4 */ #endif /* SVR4 */
if (fd == ERROR) return; if (fd == ERROR)
return;
if (client_num >= MaxClientNum || client_num >= max_client) { if (client_num >= MaxClientNum || client_num >= max_client) {
warning_out("No more client"); warning_out("No more client");
} } else {
else {
debug_out(1, "client create(%d)\r\n", fd); debug_out(1, "client create(%d)\r\n", fd);
logging_out("connect to client on %d", fd); logging_out("connect to client on %d", fd);
if ((client_tmp = (Client *)malloc(sizeof(Client))) != NULL) { if ((client_tmp = (Client *)malloc(sizeof(Client))) != NULL) {
memset(client_tmp, 0, sizeof(Client)); memset(client_tmp, 0, sizeof(Client));
client_tmp->fd = fd; client_tmp->fd = fd;
@ -603,9 +589,9 @@ connect_client(fd_set *readfds)
client_tmp->next = client; client_tmp->next = client;
client = client_tmp; client = client_tmp;
client_num++; client_num++;
set_fd(fd); set_fd(fd);
return; return;
} }
warning_out("No more client(Can't alloc)"); warning_out("No more client(Can't alloc)");
@ -630,38 +616,38 @@ connect_client(fd_set *readfds)
} }
static Client *
static Client*
disconnect_client(Client *cp) disconnect_client(Client *cp)
{ {
WorkArea *wp; WorkArea *wp;
StdyFile *sp; StdyFile *sp;
int fd; int fd;
Client *cl_tmp, *cl_before; Client *cl_before, *cl_tmp;
if ((sp = cp->stdy) != NULL)
closestdy(sp);
if ((wp = cp->work) != NULL)
free_workarea(wp);
if ((sp = cp->stdy) != NULL) closestdy(sp);
if ((wp = cp->work) != NULL) free_workarea(wp);
debug_out(1, "client dead(%d)\r\n", cp->fd); debug_out(1, "client dead(%d)\r\n", cp->fd);
logging_out("disconnect from client on %d", cp->fd); logging_out("disconnect from client on %d", cp->fd);
#ifdef TLI #ifdef TLI
#ifdef SOCK_UNIX #ifdef SOCK_UNIX
if (cp->unix_flag) { if (cp->unix_flag) {
shutdown(fd = cp->fd, 2); shutdown(fd = cp->fd, 2);
close(fd); close(fd);
clr_fd(fd); clr_fd(fd);
} else { } else {
fd = cp->fd; fd = cp->fd;
t_sndrel(fd); t_sndrel(fd);
t_close(fd); t_close(fd);
clr_fd(fd); clr_fd(fd);
} }
#else #else
fd = cp->fd; fd = cp->fd;
t_sndrel(fd); t_sndrel(fd);
t_close(fd); t_close(fd);
clr_fd(fd); clr_fd(fd);
#endif #endif
#else #else
shutdown(fd = cp->fd, 2); shutdown(fd = cp->fd, 2);
@ -686,56 +672,52 @@ disconnect_client(Client *cp)
} }
cp = cl_before->next; cp = cl_before->next;
} }
client_num--; client_num--;
return cp; return cp;
} }
#ifndef SIGPIPE
#include <signal.h>
#endif
void void
communicate(void) communicate(void)
{ {
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
for ( ; ; ) { for (; ;) {
#ifdef SVR4 #ifdef SVR4
int i; int i;
while(poll(poll_fds, maxfds, -1) == ERROR) { while (poll(poll_fds, maxfds, -1) == ERROR) {
if (errno != EINTR) error_out("poll"); if (errno != EINTR)
error_out("poll");
errno = 0; errno = 0;
} }
#else #else
fd_set readfds; fd_set readfds;
readfds = fds_org; readfds = fds_org;
while (select(maxfds,&readfds,NULL,NULL,NULL) == ERROR) { while (select(maxfds, &readfds, NULL, NULL, NULL) == ERROR) {
if (errno != EINTR) error_out("select"); if (errno != EINTR)
error_out("select");
errno = 0; errno = 0;
} }
#endif #endif
for (cur_client = client ; cur_client; ) { for (cur_client = client; cur_client;) {
if (setjmp(client_dead)) { if (setjmp(client_dead)) {
cur_client = disconnect_client(cur_client); cur_client = disconnect_client(cur_client);
continue; continue;
} }
#ifdef SVR4 #ifdef SVR4
for ( i = 0; i < maxfds; i++) { for (i = 0; i < maxfds; i++) {
if ((poll_fds[i].fd == cur_client->fd) && if ((poll_fds[i].fd == cur_client->fd) &&
(poll_fds[i].revents == POLLIN)) { (poll_fds[i].revents == POLLIN)) {
poll_fds[i].revents = 0; poll_fds[i].revents = 0;
client_fd = cur_client->fd; client_fd = cur_client->fd;
putpos = buflen = getpos = 0; putpos = buflen = getpos = 0;
execute_cmd(); execute_cmd();
break; break;
} }
} }
cur_client = cur_client->next; cur_client = cur_client->next;
} }
@ -753,33 +735,29 @@ communicate(void)
} }
} }
void void
put_flush(void) put_flush(void)
{ {
int len; int i, len;
int i;
char *p; char *p;
for (len = putpos, p = putbuf ; len > 0 ; ) { for (len = putpos, p = putbuf; len > 0;) {
if ((i = write(client_fd, p, len)) == ERROR) { if ((i = write(client_fd, p, len)) == ERROR)
longjmp(client_dead, -1); longjmp(client_dead, -1);
}
len -= i; len -= i;
p += i; p += i;
} }
putpos = 0; putpos = 0;
} }
void void
put_byte(int c) put_byte(int c)
{ {
putbuf[putpos++] = c; putbuf[putpos++] = c;
if (putpos >= sizeof(putbuf)) put_flush(); if (putpos >= sizeof(putbuf))
put_flush();
} }
void void
put_work(int c) put_work(int c)
{ {
@ -787,7 +765,6 @@ put_work(int c)
put_byte(c & 0xff); put_byte(c & 0xff);
} }
void void
put_int(int c) put_int(int c)
{ {
@ -797,39 +774,40 @@ put_int(int c)
put_byte(c); put_byte(c);
} }
u_char *
u_char* put_string(u_char *p)
put_string(u_char* p)
{ {
if (p) { if (p) {
do { do {
put_byte(*p); put_byte(*p);
} while (*p++); } while (*p++);
} } else {
else
put_byte(0); put_byte(0);
}
return p; return p;
} }
u_char *
u_char* put_ndata(u_char *p, int n)
put_ndata(u_char* p, int n)
{ {
while (n-- > 0) put_byte(p ? *p++ : 0); while (n-- > 0)
put_byte(p ? *p++ : 0);
return p; return p;
} }
void void
get_buf(void) get_buf(void)
{ {
int i; int i;
for (;;) { for (;;) {
if ((i = read(client_fd, getbuf, sizeof(getbuf))) > 0) break; if ((i = read(client_fd, getbuf, sizeof(getbuf))) > 0)
break;
if (i == ERROR) { if (i == ERROR) {
if (errno == EINTR) continue; if (errno == EINTR)
if (errno == EWOULDBLOCK) continue; continue;
if (errno == EWOULDBLOCK)
continue;
} }
longjmp(client_dead, -1); longjmp(client_dead, -1);
} }
@ -837,56 +815,52 @@ get_buf(void)
getpos = 0; getpos = 0;
} }
int int
get_byte(void) get_byte(void)
{ {
if (getpos >= buflen) get_buf(); if (getpos >= buflen)
return (getbuf[getpos++] & 0xff); get_buf();
return getbuf[getpos++] & 0xff;
} }
int int
get_word(void) get_word(void)
{ {
int i; int i;
i = get_byte(); i = get_byte();
return ((i << 8) | get_byte()); return (i << 8) | get_byte();
} }
int int
get_int(void) get_int(void)
{ {
int i0; int i0, i1, i2;
int i1;
int i2;
i0 = get_byte(); i0 = get_byte();
i1 = get_byte(); i1 = get_byte();
i2 = get_byte(); i2 = get_byte();
return((i0 << (8*3)) | (i1 << (8*2)) | (i2 << (8*1)) | get_byte()); return (i0 << (8*3)) | (i1 << (8*2)) | (i2 << (8*1)) | get_byte();
} }
int int
get_nstring(u_char* p, int n) get_nstring(u_char *p, int n)
{ {
int c; int c;
do { do {
c = get_byte(); c = get_byte();
if (n-- > 0) *p++ = c; if (n-- > 0)
*p++ = c;
} while (c); } while (c);
return (n < 0) ? ERROR : 0; return (n < 0) ? ERROR : 0;
} }
u_char *
u_char* get_ndata(u_char *p, int n)
get_ndata(u_char* p, int n)
{ {
while (n-- > 0) *p++ = get_byte(); while (n-- > 0)
*p++ = get_byte();
return p; return p;
} }

View file

@ -2,7 +2,7 @@
* SPDX-License-Identifier: MIT-open-group * SPDX-License-Identifier: MIT-open-group
* *
* Copyright (c) 1991-1994 Sony Corporation * Copyright (c) 1991-1994 Sony Corporation
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@ -10,10 +10,10 @@
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice shall be * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software. * included in all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -21,57 +21,52 @@
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* Except as contained in this notice, the name of Sony Corporation * Except as contained in this notice, the name of Sony Corporation
* shall not be used in advertising or otherwise to promote the sale, use * shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization * or other dealings in this Software without prior written authorization
* from Sony Corporation. * from Sony Corporation.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include "sj_typedef.h"
#include "server.h" #include "server.h"
#include "sj_typedef.h"
extern char program_name[]; extern char program_name[];
extern int debug_level; extern int debug_level;
extern int client_fd; extern int client_fd;
static char *tty_name = "/dev/tty";
static FILE *errfp = NULL;
static FILE *logfp = NULL;
static FILE *dbgfp = NULL;
static char *tty_name = "/dev/tty";
static FILE *errfp = NULL;
static FILE *logfp = NULL;
static FILE *dbgfp = NULL;
int int
open_error(void) open_error(void)
{ {
extern char *error_file; extern char *error_file;
int flg = 0; int flg = 0;
if (error_file && *error_file) { if (error_file && *error_file) {
if (!strcmp(error_file, tty_name)) { if (!strcmp(error_file, tty_name)) {
errfp = stderr; errfp = stderr;
flg = -1; flg = -1;
} } else if (!(errfp = fopen(error_file, "a"))) {
else if (!(errfp = fopen(error_file, "a")))
fprintf(stderr, "Can't open \"%s\"\r\n", error_file); fprintf(stderr, "Can't open \"%s\"\r\n", error_file);
} }
else } else {
errfp = NULL; errfp = NULL;
}
return flg; return flg;
} }
void void
error_out(char* s, int p1, int p2, int p3, int p4, int p5) error_out(char *s, int p1, int p2, int p3, int p4, int p5)
{ {
char tmp[BUFSIZ]; char tmp[BUFSIZ];
@ -83,9 +78,8 @@ error_out(char* s, int p1, int p2, int p3, int p4, int p5)
exit(1); exit(1);
} }
void void
warning_out(char* s, int p1, int p2, int p3, int p4, int p5) warning_out(char *s, int p1, int p2, int p3, int p4, int p5)
{ {
char tmp[BUFSIZ]; char tmp[BUFSIZ];
@ -96,40 +90,38 @@ warning_out(char* s, int p1, int p2, int p3, int p4, int p5)
} }
} }
int int
open_log(void) open_log(void)
{ {
extern char *log_file; extern char *log_file;
int flg = 0; int flg = 0;
if (log_file && *log_file) { if (log_file && *log_file) {
if (!strcmp(log_file, tty_name)) { if (!strcmp(log_file, tty_name)) {
logfp = stderr; logfp = stderr;
flg = -1; flg = -1;
} } else {
else
logfp = fopen(log_file, "a"); logfp = fopen(log_file, "a");
}
if (logfp) { if (logfp) {
time_t t; time_t t;
time(&t); time(&t);
fprintf(logfp, "%s: log started at %s\r", fprintf(logfp, "%s: log started at %s\r",
program_name, ctime(&t)); program_name, ctime(&t));
fflush(logfp); fflush(logfp);
} } else {
else
fprintf(stderr, "Can't open \"%s\"\r\n", log_file); fprintf(stderr, "Can't open \"%s\"\r\n", log_file);
} }
else } else {
logfp = NULL; logfp = NULL;
}
return flg; return flg;
} }
void void
logging_out(char* s, int p1, int p2, int p3, int p4, int p5) logging_out(char *s, int p1, int p2, int p3, int p4, int p5)
{ {
char tmp[BUFSIZ]; char tmp[BUFSIZ];
@ -140,30 +132,28 @@ logging_out(char* s, int p1, int p2, int p3, int p4, int p5)
} }
} }
int int
open_debug(void) open_debug(void)
{ {
extern char *debug_file; extern char *debug_file;
int flg = 0; int flg = 0;
if (debug_file && *debug_file) { if (debug_file && *debug_file) {
if (!strcmp(debug_file, tty_name)) { if (!strcmp(debug_file, tty_name)) {
dbgfp = stderr; dbgfp = stderr;
flg = -1; flg = -1;
} } else if (!(dbgfp = fopen(debug_file, "a"))) {
else if (!(dbgfp = fopen(debug_file, "a")))
fprintf(stderr, "Can't open \"%s\"\r\n", debug_file); fprintf(stderr, "Can't open \"%s\"\r\n", debug_file);
} }
else } else {
dbgfp = NULL; dbgfp = NULL;
}
return flg; return flg;
} }
void void
debug_out(int lvl, char* s, int p1, int p2, int p3, int p4, int p5) debug_out(int lvl, char *s, int p1, int p2, int p3, int p4, int p5)
{ {
if (lvl <= debug_level && dbgfp) { if (lvl <= debug_level && dbgfp) {
fprintf(dbgfp, s, p1, p2, p3, p4, p5); fprintf(dbgfp, s, p1, p2, p3, p4, p5);

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/*- /*-
* SPDX-License-Identifier: MIT-open-group * SPDX-License-Identifier: MIT-open-group
* *
* Copyright (c) 1991-1994 Sony Corporation * Copyright (c) 1991-1994 Sony Corporation
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@ -10,10 +10,10 @@
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice shall be * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software. * included in all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -21,7 +21,7 @@
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* Except as contained in this notice, the name of Sony Corporation * Except as contained in this notice, the name of Sony Corporation
* shall not be used in advertising or otherwise to promote the sale, use * shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization * or other dealings in this Software without prior written authorization
@ -29,11 +29,7 @@
*/ */
#include "sj_sysvdef.h" #include "sj_sysvdef.h"
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h> #include <sys/types.h>
@ -52,46 +48,37 @@
#define signal sigset #define signal sigset
#endif #endif
extern int fork_flag; extern int fork_flag;
extern char *lock_file; extern char *lock_file;
#ifdef LOCK_FILE #ifdef LOCK_FILE
int int
make_lockfile (void) make_lockfile(void)
{ {
int fd; int fd;
fd = open(lock_file, O_CREAT | O_EXCL, 0600); fd = open(lock_file, O_CREAT | O_EXCL, 0600);
if (fd < 0) return ERROR; if (fd < 0)
return ERROR;
close(fd); close(fd);
return 0; return 0;
} }
int int
erase_lockfile (void) erase_lockfile(void)
{ {
return unlink(lock_file); return unlink(lock_file);
} }
#endif #endif
static int static int
signal_handler (sig, code, scp) signal_handler(int sig, int code, struct sigcontext *scp)
int sig;
int code;
struct sigcontext *scp;
{ {
warning_out("signal %d, code %d catched.", sig, code); warning_out("signal %d, code %d catched.", sig, code);
} }
static int terminate_handler(sig, code, scp) static int
int sig; terminate_handler(int sig, int code, struct sigcontext *scp)
int code;
struct sigcontext *scp;
{ {
close_socket(); close_socket();
sj_closeall(); sj_closeall();
@ -102,7 +89,7 @@ struct sigcontext *scp;
} }
void void
server_terminate (void) server_terminate(void)
{ {
close_socket(); close_socket();
sj_closeall(); sj_closeall();
@ -112,10 +99,8 @@ server_terminate (void)
exit(0); exit(0);
} }
static void
exec_fork(void)
static void
exec_fork (void)
{ {
int tmp; int tmp;
@ -123,11 +108,10 @@ exec_fork (void)
if (tmp < 0) { if (tmp < 0) {
fprintf(stderr, "Can't fork child process\r\n"); fprintf(stderr, "Can't fork child process\r\n");
fflush(stderr); fflush(stderr);
} } else {
else {
signal(SIGCHLD, _exit); signal(SIGCHLD, _exit);
signal(SIGHUP , SIG_IGN); signal(SIGHUP, SIG_IGN);
signal(SIGINT , SIG_IGN); signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN); signal(SIGQUIT, SIG_IGN);
signal(SIGTSTP, SIG_IGN); signal(SIGTSTP, SIG_IGN);
signal(SIGTERM, _exit); signal(SIGTERM, _exit);
@ -136,30 +120,28 @@ exec_fork (void)
} }
} }
signal(SIGHUP, (void (*)())signal_handler); signal(SIGHUP, (void (*)())signal_handler);
signal(SIGINT, (void (*)())terminate_handler);
signal(SIGINT, (void (*)())terminate_handler);
signal(SIGQUIT, (void (*)())signal_handler); signal(SIGQUIT, (void (*)())signal_handler);
signal(SIGTERM, (void (*)())terminate_handler); signal(SIGTERM, (void (*)())terminate_handler);
if (fork_flag) if (fork_flag)
signal(SIGTSTP, SIG_IGN); signal(SIGTSTP, SIG_IGN);
} }
static void
leave_tty(void)
static void
leave_tty (void)
{ {
int tmp; int tmp;
tmp = open_error(); tmp = open_error();
tmp |= open_log(); tmp |= open_log();
tmp |= open_debug(); tmp |= open_debug();
kill(getppid(), SIGTERM); kill(getppid(), SIGTERM);
fclose(stdin); fclose(stdin);
fclose(stdout); fclose(stdout);
if (!tmp) fclose(stderr); if (!tmp)
fclose(stderr);
if (fork_flag) { if (fork_flag) {
if ((tmp = open("/dev/tty", O_RDWR)) >= 0) { if ((tmp = open("/dev/tty", O_RDWR)) >= 0) {
@ -169,33 +151,33 @@ leave_tty (void)
} }
} }
int int
main (int argc, char **argv) main(int argc, char **argv)
{ {
#ifndef __NetBSD__ #ifndef __NetBSD__
if (setuid(geteuid())) { if (setuid(geteuid())) {
fprintf(stderr, "error at setuid.\r\n"); exit(1); fprintf(stderr, "error at setuid.\r\n");
exit(1);
} }
#endif #endif
parse_arg(argc, argv); parse_arg(argc, argv);
read_runcmd(); read_runcmd();
set_default(); set_default();
#ifdef LOCK_FILE #ifdef LOCK_FILE
if (make_lockfile() == ERROR) { if (make_lockfile() == ERROR) {
fprintf(stderr, "Already running...\r\n"); exit(1); fprintf(stderr, "Already running...\r\n");
exit(1);
} }
#endif #endif
exec_fork(); exec_fork();
socket_init(); socket_init();
open_socket(); open_socket();
leave_tty(); leave_tty();
preload_dict(); preload_dict();
preopen_dict(); preopen_dict();

View file

@ -1,8 +1,8 @@
/*- /*-
* SPDX-License-Identifier: MIT-open-group * SPDX-License-Identifier: MIT-open-group
* *
* Copyright (c) 1991-1994 Sony Corporation * Copyright (c) 1991-1994 Sony Corporation
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@ -10,10 +10,10 @@
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice shall be * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software. * included in all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -21,17 +21,11 @@
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* Except as contained in this notice, the name of Sony Corporation * Except as contained in this notice, the name of Sony Corporation
* shall not be used in advertising or otherwise to promote the sale, use * shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization * or other dealings in this Software without prior written authorization
* from Sony Corporation. * from Sony Corporation.
*/ */
char *time_stamp = "Mon Mar 23 16:42:59 JST 1998"; char *time_stamp = "Mon Mar 23 16:42:59 JST 1998";

View file

@ -1,8 +1,8 @@
/*- /*-
* SPDX-License-Identifier: MIT-open-group * SPDX-License-Identifier: MIT-open-group
* *
* Copyright (c) 1991-1994 Sony Corporation * Copyright (c) 1991-1994 Sony Corporation
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
@ -10,10 +10,10 @@
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice shall be * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software. * included in all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -21,16 +21,11 @@
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* Except as contained in this notice, the name of Sony Corporation * Except as contained in this notice, the name of Sony Corporation
* shall not be used in advertising or otherwise to promote the sale, use * shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization * or other dealings in this Software without prior written authorization
* from Sony Corporation. * from Sony Corporation.
*/ */
char *version_number = "2.08C"; char *version_number = "2.08C";