From 6751cd55df0bd223a315bed70db10566fe703606 Mon Sep 17 00:00:00 2001 From: Masanori Ogino Date: Fri, 8 Dec 2023 12:16:44 +0900 Subject: [PATCH] sj3serv: Cleanup Signed-off-by: Masanori Ogino --- Makefile | 2 +- Makefile.depend | 6 ++-- main.c | 91 ++++++++++--------------------------------------- time_stamp.c | 41 ---------------------- version.c | 40 ---------------------- 5 files changed, 21 insertions(+), 159 deletions(-) delete mode 100644 time_stamp.c delete mode 100644 version.c diff --git a/Makefile b/Makefile index a8b4b06..88112d2 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ SJ3MKDIC_OBJS = char.o cnvhinsi.o file.o global.o hindo.o knjcvt.o makedict.o \ SJ3STAT_OBJS = sj3stat.o # Server daemon -SJ3SERV_OBJS = comuni.o error.o execute.o main.o setup.o time_stamp.o version.o +SJ3SERV_OBJS = comuni.o error.o execute.o main.o setup.o ALL_OBJS = $(SJ3LIB_OBJS) $(KANAKAN_OBJS) $(SJ3RKCV_OBJS) $(SJ3_OBJS) \ $(SJ3DIC_OBJS) $(SJ3MKDIC_OBJS) $(SJ3STAT_OBJS) $(SJ3SERV_OBJS) diff --git a/Makefile.depend b/Makefile.depend index 3748e9b..cef324e 100644 --- a/Makefile.depend +++ b/Makefile.depend @@ -118,8 +118,8 @@ knjcvt.o: knjcvt.c sj_const.h sj_euc.h sj_sysvdef.h sj_struct.h \ level1.o: level1.c config.h Const.h Paths.h sj3cmd.h sj3err.h sj3lib.h libif.o: libif.c sj_sysvdef.h wchar16.h key.h kctype.h common.h \ conversion.h sj2.h sj3libsj3.h sj3lib.h henkan.h -main.o: main.c sj_sysvdef.h Const.h Paths.h server.h Struct.h sj_const.h \ - sj_euc.h sj_dict.h sj_struct.h sj_typedef.h sj_var.h +main.o: main.c config.h sj_sysvdef.h Const.h Paths.h server.h Struct.h \ + sj_const.h sj_euc.h sj_dict.h sj_struct.h sj_typedef.h sj_var.h makedict.o: makedict.c sj_const.h sj_euc.h sj_sysvdef.h dicttool.h \ sj_struct2.h sj_const2.h makelist.o: makelist.c sj_struct.h sj_typedef.h dicttool.h sj_struct2.h \ @@ -263,10 +263,8 @@ terminat.o: terminat.c sj_kcnv.h sj_typedef.h sj_rename.h sj_const.h \ termtbl.o: termtbl.c sj_rename.h sj_typedef.h sj_const.h sj_euc.h \ sj_sysvdef.h sj_prty.h tests.o: tests.c -time_stamp.o: time_stamp.c toroku.o: toroku.c common.h conversion.h sj2.h wchar16.h key.h \ sj_sysvdef.h sj3libsj3.h sj3lib.h henkan.h -version.o: version.c version2.o: version2.c sj2.h wchar16.h key.h sj_sysvdef.h wakachi.o: wakachi.c sj_kcnv.h sj_typedef.h sj_rename.h sj_const.h \ sj_euc.h sj_sysvdef.h sj_var.h sj_dict.h sj_study.h sj_table.h \ diff --git a/main.c b/main.c index e53d86b..b605f40 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,8 @@ -/* +/*- + * SPDX-License-Identifier: MIT-open-group + * * Copyright (c) 1991-1994 Sony Corporation - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -8,10 +10,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -19,60 +21,40 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * * Except as contained in this notice, the name of Sony Corporation * shall not be used in advertising or otherwise to promote the sale, use * or other dealings in this Software without prior written authorization * from Sony Corporation. - * */ -/* - * $SonyRCSfile: main.c,v $ - * $SonyRevision: 1.3 $ - * $SonyDate: 1995/02/03 07:38:44 $ - * - * $Id$ - */ - - +#include "config.h" #include "sj_sysvdef.h" -#include -#include -#include -#include -#include + #include #include +#include #include + +#include +#include +#include +#include #include -#ifdef SVR4 -#include -#include -#endif + #include "Const.h" #include "server.h" -#ifndef lint -static char rcsid_sony[] = "$Header: /export/work/contrib/sj3/server/RCS/main.c,v 1.12 1994/06/03 07:41:30 notanaka Exp $ SONY;"; -#endif - -#ifdef SVR4 -#define signal sigset -#endif - extern int fork_flag; extern char *lock_file; - +char *version_number = "2.08C"; +char *time_stamp = "Mon Mar 23 16:42:59 JST 1998"; static void opening (void) { - extern char *version_number; - extern char *time_stamp; - printf("Kana-Kanji Conversion Server Version %s\r\n", version_number); printf("Copyright (c) 1990-1995 Sony Corporation\r\n"); printf("Created at %s\r\n", time_stamp); @@ -100,10 +82,6 @@ erase_lockfile (void) } #endif - - - -#if !defined(__sony_news) || defined(SVR4) static int signal_handler (int sig) { @@ -121,31 +99,6 @@ terminate_handler (int sig) exit(0); } -#else /* __sony_news && !SVR4 */ -static int -signal_handler (sig, code, scp) -int sig; -int code; -struct sigcontext *scp; -{ - warning_out("signal %d, code %d catched.", sig, code); -} - -static int terminate_handler(sig, code, scp) -int sig; -int code; -struct sigcontext *scp; -{ - close_socket(); - sj_closeall(); -#ifdef LOCK_FILE - erase_lockfile(); -#endif - exit(0); -} -#endif /* __sony_news && !SVR4 */ - - void server_terminate (void) { @@ -157,8 +110,6 @@ server_terminate (void) exit(0); } - - static void exec_fork (void) { @@ -207,9 +158,6 @@ leave_tty (void) if (!tmp) fclose(stderr); if (fork_flag) { -#ifdef SVR4 - (void) setsid(); -#else if ((tmp = open("/dev/tty", O_RDWR)) >= 0) { ioctl(tmp, TIOCNOTTY, 0); close(tmp); @@ -223,9 +171,6 @@ leave_tty (void) int main (int argc, char **argv) { -#ifdef __sony_news - (void) setlocale(LC_CTYPE, "ja_JP.EUC"); -#endif opening(); #ifndef __NetBSD__ if (setuid(geteuid())) { diff --git a/time_stamp.c b/time_stamp.c deleted file mode 100644 index b46bbbf..0000000 --- a/time_stamp.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1991-1994 Sony Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of Sony Corporation - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from Sony Corporation. - * - */ - -/* - * $SonyRCSfile: time_stamp.c,v $ - * $SonyRevision: 1.6 $ - * $SonyDate: 1998/04/08 13:11:10 $ - */ - - - - - -char *time_stamp = "Mon Mar 23 16:42:59 JST 1998"; - diff --git a/version.c b/version.c deleted file mode 100644 index 402d14a..0000000 --- a/version.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1991-1994 Sony Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of Sony Corporation - * shall not be used in advertising or otherwise to promote the sale, use - * or other dealings in this Software without prior written authorization - * from Sony Corporation. - * - */ - -/* - * $SonyRCSfile: version.c,v $ - * $SonyRevision: 1.9 $ - * $SonyDate: 1998/04/08 13:11:10 $ - */ - - - - - -char *version_number = "2.08C";