Index: mac_signal_README.txt =================================================================== --- mac_signal_README.txt (revision 0) +++ mac_signal_README.txt (revision 0) @@ -0,0 +1,50 @@ +This README contains some background information on the mac_signal patch +for bbs100 3.2 + +On MacOS X, compilation of the bbs caused some warnings. These warning +messages are harmless, but I like having a clean build. + +So, what's the deal? +On MacOS X, the filesystem is case insensitive. This means that the names +'foo', 'Foo', and even 'FOO' are all referring to the same file. + +As a consequence, when you compile the bbs with + + gcc -Iinclude $(CFLAGS) -c $< + +as the bbs's Makefile does, it would find that + + #include "Signal.h" + +and + + #include + +both resolve to the file include/Signal.h ! +This is, of course, unintended and all wrong, because I would like +to use /usr/include/signal.h at times, too. + +The way to solve this is to remove include/Signal.h and rename it +to bbs_Signal.h +As it turns out, the diff/patch command can not delete files, so +after applying the mac_signal patch, you will have to remove the +old (now empty) include/Signal.h by hand. In other words, to use +this patch run: + + cd bbs100/src + patch -p0 < mac_signal-3_2.diff + if [ ! -s include/Signal.h ] + then + rm include/Signal.h + echo done + else + echo something is not ok + fi + +configure and make the bbs as usual. + + +Greets, + + --Walter + Index: inet.c =================================================================== --- inet.c (revision 3) +++ inet.c (working copy) @@ -38,7 +38,7 @@ #include "cstring.h" #include "log.h" #include "User.h" -#include "Signal.h" +#include "bbs_Signal.h" #include "memset.h" #include "bufprintf.h" #include "cstrerror.h" Index: include/Signal.h =================================================================== --- include/Signal.h (revision 3) +++ include/Signal.h (working copy) @@ -1,122 +0,0 @@ -/* - bbs100 3.2 WJ107 - Copyright (C) 2007 Walter de Jong - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -/* - Signal.h WJ97 -*/ - -#ifndef SIGNAL_H_WJ97 -#define SIGNAL_H_WJ97 1 - -#include -#include "SignalVector.h" - -#include -#include - -#define MAX_SIGNAME 64 /* for sig_name() */ - -/* - the following is for weird development environments that usually don't - have signals - The code will compile, but you will miss some functionality, because - the OS doesn't really support the defined signals -*/ -#ifndef SIGINT -#define SIGINT 2 -#endif - -#ifndef SIGKILL -#define SIGKILL 9 -#endif - -#ifndef SIGPIPE -#define SIGPIPE 13 -#endif - -#ifndef SIGTERM -#define SIGTERM 15 -#endif - -/* - actually, SIGCHLD and SIGCONT can have other values on different implementations - so defining them yourself is not a very solid solution -*/ -#ifndef SIGCHLD -#define SIGCHLD 17 -#endif - -#ifndef SIGCLD -#define SIGCLD SIGCHLD -#endif - -#ifndef SIGCONT -#define SIGCONT 18 -#endif - -#ifndef SIG_DFL -#define SIG_DFL ((RETSIGTYPE (*)(int))0) /* default action */ -#endif - -#ifndef SIG_IGN -#define SIG_IGN ((RETSIGTYPE (*)(int))1) /* ignore action */ -#endif - -#ifndef SIG_ERR -#define SIG_ERR ((RETSIGTYPE (*)(int))-1) /* error return */ -#endif - - -typedef struct { - int sig; - void (*default_handler)(int); - char *sig_name; - SignalVector *handlers; -} SigTable; - -extern int jump_set; -extern jmp_buf jumper; -extern SigTable sig_table[]; - -void init_Signal(int); -void deinit_Signal(void); -char *sig_name(int, char *, int); - -int set_Signal(int, void (*)(int)); -void remove_Signal(int, void (*)(int)); - -RETSIGTYPE catch_signal(int); -RETSIGTYPE catch_sigfatal(int); -void handle_pending_signals(void); - -void block_all_signals(void); -void unblock_all_signals(void); -void block_timer_signals(int); - -void sig_fatal(int); -void sig_reboot(int); -void sig_shutdown(int); -void sig_shutnow(int); -void sig_mail(int); -void sig_nologin(int); - -void crash_recovery(void); - -#endif /* SIGNAL_H_WJ97 */ - -/* EOB */ Index: Signal.c =================================================================== --- Signal.c (revision 3) +++ Signal.c (working copy) @@ -21,7 +21,7 @@ */ #include "config.h" -#include "Signal.h" +#include "bbs_Signal.h" #include "debug.h" #include "main.h" #include "cstring.h" Index: Timer.c =================================================================== --- Timer.c (revision 3) +++ Timer.c (working copy) @@ -28,7 +28,7 @@ #include "config.h" #include "Timer.h" #include "User.h" -#include "Signal.h" +#include "bbs_Signal.h" #include "sys_time.h" #include "cstring.h" #include "Memory.h" Index: state_sysop.c =================================================================== --- state_sysop.c (revision 3) +++ state_sysop.c (working copy) @@ -55,7 +55,7 @@ #include "OnlineUser.h" #include "Category.h" #include "Wrapper.h" -#include "Signal.h" +#include "bbs_Signal.h" #include "memset.h" #include "bufprintf.h" #include "BinAlloc.h" Index: Process.c =================================================================== --- Process.c (revision 3) +++ Process.c (working copy) @@ -27,7 +27,7 @@ #include "inet.h" #include "util.h" #include "log.h" -#include "Signal.h" +#include "bbs_Signal.h" #include "cstring.h" #include "Param.h" #include "ConnResolv.h" Index: main.c =================================================================== --- main.c (revision 3) +++ main.c (working copy) @@ -33,7 +33,7 @@ #include "Wrapper.h" #include "Process.h" #include "SU_Passwd.h" -#include "Signal.h" +#include "bbs_Signal.h" #include "Timer.h" #include "util.h" #include "log.h" Index: include/bbs_Signal.h =================================================================== --- include/bbs_Signal.h (revision 0) +++ include/bbs_Signal.h (revision 0) @@ -0,0 +1,122 @@ +/* + bbs100 3.2 WJ107 + Copyright (C) 2007 Walter de Jong + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + Signal.h WJ97 +*/ + +#ifndef SIGNAL_H_WJ97 +#define SIGNAL_H_WJ97 1 + +#include +#include "SignalVector.h" + +#include +#include + +#define MAX_SIGNAME 64 /* for sig_name() */ + +/* + the following is for weird development environments that usually don't + have signals + The code will compile, but you will miss some functionality, because + the OS doesn't really support the defined signals +*/ +#ifndef SIGINT +#define SIGINT 2 +#endif + +#ifndef SIGKILL +#define SIGKILL 9 +#endif + +#ifndef SIGPIPE +#define SIGPIPE 13 +#endif + +#ifndef SIGTERM +#define SIGTERM 15 +#endif + +/* + actually, SIGCHLD and SIGCONT can have other values on different implementations + so defining them yourself is not a very solid solution +*/ +#ifndef SIGCHLD +#define SIGCHLD 17 +#endif + +#ifndef SIGCLD +#define SIGCLD SIGCHLD +#endif + +#ifndef SIGCONT +#define SIGCONT 18 +#endif + +#ifndef SIG_DFL +#define SIG_DFL ((RETSIGTYPE (*)(int))0) /* default action */ +#endif + +#ifndef SIG_IGN +#define SIG_IGN ((RETSIGTYPE (*)(int))1) /* ignore action */ +#endif + +#ifndef SIG_ERR +#define SIG_ERR ((RETSIGTYPE (*)(int))-1) /* error return */ +#endif + + +typedef struct { + int sig; + void (*default_handler)(int); + char *sig_name; + SignalVector *handlers; +} SigTable; + +extern int jump_set; +extern jmp_buf jumper; +extern SigTable sig_table[]; + +void init_Signal(int); +void deinit_Signal(void); +char *sig_name(int, char *, int); + +int set_Signal(int, void (*)(int)); +void remove_Signal(int, void (*)(int)); + +RETSIGTYPE catch_signal(int); +RETSIGTYPE catch_sigfatal(int); +void handle_pending_signals(void); + +void block_all_signals(void); +void unblock_all_signals(void); +void block_timer_signals(int); + +void sig_fatal(int); +void sig_reboot(int); +void sig_shutdown(int); +void sig_shutnow(int); +void sig_mail(int); +void sig_nologin(int); + +void crash_recovery(void); + +#endif /* SIGNAL_H_WJ97 */ + +/* EOB */