1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-27 15:55:06 +01:00

53081: remove old BeOS support code

This commit is contained in:
Oliver Kiddle 2024-09-14 19:21:58 +02:00
parent 79593399c4
commit 8dd271fdec
7 changed files with 5 additions and 206 deletions

View file

@ -1,5 +1,8 @@
2024-09-14 Oliver Kiddle <opk@zsh.org>
* 53081: INSTALL, configure.ac, Src/init.c, Src/options.c,
Src/signals.c, Src/zsh_system.h: remove old BeOS support code
* 53080: configure.ac, Src/init.c, Src/signals.c, Src/signals.h:
remove code for systems that only have the old pre-POSIX signal()

View file

@ -576,13 +576,6 @@ shell is running in some privileged mode. This is turned off by
default as on some systems non-standard headers (in particular AIX) are
required. A direct fix for that problem would be appreciated.
A test for the function tcsetpgrp is turned on by default. The test
needs to run the function to determine if the implementation is
usable. However, this can cause problems when configure is run without
a controlling terminal (eg. from cron). To avoid this, use
--with-tcsetpgrp or --without-tcsetpgrp to tell configure whether the
function should be used.
Options For Configure
---------------------

View file

@ -695,7 +695,6 @@ init_io(char *cmd)
} else
opts[USEZLE] = 0;
#ifdef JOB_CONTROL
/* If interactive, make sure the shell is in the foreground and is the
* process group leader.
*/
@ -708,9 +707,6 @@ init_io(char *cmd)
acquire_pgrp(); /* might also clear opts[MONITOR] */
}
}
#else
opts[MONITOR] = 0;
#endif
}
/**/
@ -718,7 +714,7 @@ mod_export void
init_shout(void)
{
static char shoutbuf[BUFSIZ];
#if defined(JOB_CONTROL) && defined(TIOCSETD) && defined(NTTYDISC)
#if defined(TIOCSETD) && defined(NTTYDISC)
int ldisc;
#endif
@ -729,7 +725,7 @@ init_shout(void)
return;
}
#if defined(JOB_CONTROL) && defined(TIOCSETD) && defined(NTTYDISC)
#if defined(TIOCSETD) && defined(NTTYDISC)
ldisc = NTTYDISC;
ioctl(SHTTY, TIOCSETD, (char *)&ldisc);
#endif

View file

@ -877,7 +877,6 @@ dosetopt(int optno, int value, int force, char *new_opts)
}
#endif /* HAVE_SETRESGID && HAVE_SETRESUID */
#ifdef JOB_CONTROL
} else if (!force && optno == MONITOR && value) {
if (new_opts[optno] == value)
return 0;
@ -887,14 +886,6 @@ dosetopt(int optno, int value, int force, char *new_opts)
origpgrp = GETPGRP();
acquire_pgrp();
}
#else
} else if(optno == MONITOR && value) {
return -1;
#endif /* not JOB_CONTROL */
#ifdef GETPWNAM_FAKED
} else if(optno == CDABLEVARS && value) {
return -1;
#endif /* GETPWNAM_FAKED */
} else if ((optno == EMACSMODE || optno == VIMODE) && value) {
if (sticky && sticky->emulation)
return -1;

View file

@ -216,7 +216,6 @@ signal_suspend(UNUSED(int sig), int wait_cmd)
int ret;
sigset_t set;
sigset_t oset;
sigemptyset(&set);
@ -229,13 +228,7 @@ signal_suspend(UNUSED(int sig), int wait_cmd)
(sigtrapped[SIGINT] & ~ZSIG_IGNORED)))
sigaddset(&set, SIGINT);
# ifdef BROKEN_POSIX_SIGSUSPEND
sigprocmask(SIG_SETMASK, &set, &oset);
ret = pause();
sigprocmask(SIG_SETMASK, &oset, NULL);
# else /* not BROKEN_POSIX_SIGSUSPEND */
ret = sigsuspend(&set);
# endif /* BROKEN_POSIX_SIGSUSPEND */
return ret;
}

View file

@ -369,8 +369,6 @@ struct timespec {
# ifndef TIME_H_SELECT_H_CONFLICTS
# include <sys/select.h>
# endif
#elif defined(SELECT_IN_SYS_SOCKET_H)
# include <sys/socket.h>
#endif
#if defined(__APPLE__) && defined(HAVE_SELECT)
@ -803,16 +801,6 @@ extern short ospeed;
#endif
#endif
/* Can't support job control without working tcsetgrp() */
#ifdef BROKEN_TCSETPGRP
#undef JOB_CONTROL
#endif /* BROKEN_TCSETPGRP */
#ifdef BROKEN_KILL_ESRCH
#undef ESRCH
#define ESRCH EINVAL
#endif /* BROKEN_KILL_ESRCH */
/* Can we do locale stuff? */
#undef USE_LOCALE
#if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL)

View file

@ -2119,20 +2119,6 @@ if test x$zsh_cv_header_sys_ioctl_h_ioctl_proto = xyes; then
AC_DEFINE(IOCTL_IN_SYS_IOCTL)
fi
dnl -------------------
dnl select() defined in <sys/socket.h>, ie BeOS R4.51
dnl -------------------
AH_TEMPLATE([SELECT_IN_SYS_SOCKET_H],
[Define to 1 if select() is defined in <sys/socket.h>, ie BeOS R4.51])
if test x$ac_cv_header_sys_select_h != xyes; then
AC_CACHE_CHECK(for select() in <sys/socket.h>,
zsh_cv_header_socket_h_select_proto,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[fd_set fd;]])],[zsh_cv_header_socket_h_select_proto=yes],[zsh_cv_header_socket_h_select_proto=no])])
if test x$zsh_cv_header_socket_h_select_proto = xyes; then
AC_DEFINE(SELECT_IN_SYS_SOCKET_H)
fi
fi
dnl -----------
dnl named FIFOs
dnl -----------
@ -2266,154 +2252,6 @@ if test x$zsh_cv_sys_link = xyes; then
AC_DEFINE(HAVE_LINK)
fi
dnl -----------
dnl test for whether kill(pid, 0) where pid doesn't exit
dnl should set errno to ESRCH, but some like BeOS R4.51 set to EINVAL
dnl -----------
AC_CACHE_CHECK(if kill(pid, 0) returns ESRCH correctly,
zsh_cv_sys_killesrch,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <signal.h>
#include <errno.h>
int main()
{
int pid = (getpid() + 10000) & 0xffffff;
while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1;
return(errno!=ESRCH);
}
]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])])
AH_TEMPLATE([BROKEN_KILL_ESRCH],
[Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51.])
if test x$zsh_cv_sys_killesrch = xno; then
AC_DEFINE(BROKEN_KILL_ESRCH)
fi
dnl -----------
dnl if POSIX, test for working sigsuspend().
dnl for instance, BeOS R4.51 is broken.
dnl -----------
AH_TEMPLATE([BROKEN_POSIX_SIGSUSPEND],
Define to 1 if sigsuspend() is broken, ie BeOS R4.51.])
AC_CACHE_CHECK(if POSIX sigsuspend() works,
zsh_cv_sys_sigsuspend,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <signal.h>
#include <unistd.h>
int child=0;
void handler(sig)
int sig;
{if(sig==SIGCHLD) child=1;}
int main() {
struct sigaction act;
sigset_t set;
int pid, ret;
act.sa_handler = &handler;
sigfillset(&act.sa_mask);
act.sa_flags = 0;
sigaction(SIGCHLD, &act, 0);
sigfillset(&set);
sigprocmask(SIG_SETMASK, &set, 0);
pid=fork();
if(pid==0) return 0;
if(pid>0) {
sigemptyset(&set);
ret=sigsuspend(&set);
return(child==0);
}
}
]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])])
if test x$zsh_cv_sys_sigsuspend = xno; then
AC_DEFINE(BROKEN_POSIX_SIGSUSPEND)
fi
dnl -----------
dnl if found tcsetpgrp, test to see if it actually works
dnl for instance, BeOS R4.51 does not support it yet
dnl -----------
AH_TEMPLATE([BROKEN_TCSETPGRP],
[Define to 1 if tcsetpgrp() doesn't work, ie BeOS R4.51.])
AC_ARG_WITH(tcsetpgrp,
AS_HELP_STRING([--with-tcsetpgrp],[assumes that tcsetpgrp() exists and works correctly]),[
case "x$withval" in
xyes) zsh_working_tcsetpgrp=yes;;
xno) zsh_working_tcsetpgrp=no;;
*) AC_MSG_ERROR(please use --with-tcsetpgrp=yes or --with-tcsetpgrp=no);;
esac],[zsh_working_tcsetpgrp=check])
if test "x$ac_cv_func_tcsetpgrp" = xyes; then
case "x$zsh_working_tcsetpgrp" in
xcheck)
trap "" TTOU > /dev/null 2>&1 || :
AC_CACHE_CHECK(if tcsetpgrp() actually works,
zsh_cv_sys_tcsetpgrp,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
int fd;
int ret;
fd=open("/dev/tty", O_RDWR);
if (fd < 0) return(2);
ret=tcsetpgrp(fd, tcgetpgrp(fd));
if (ret < 0) return(1);
return(0);
}
]])],[zsh_cv_sys_tcsetpgrp=yes],[
case $? in
1) zsh_cv_sys_tcsetpgrp=no;;
2) zsh_cv_sys_tcsetpgrp=notty;;
*) zsh_cv_sys_tcsetpgrp=error;;
esac
],[zsh_cv_sys_tcsetpgrp=yes])])
case "x$zsh_cv_sys_tcsetpgrp" in
xno) AC_DEFINE(BROKEN_TCSETPGRP);;
xyes) :;;
xnotty) AC_MSG_ERROR([no controlling tty
Try running configure with --with-tcsetpgrp or --without-tcsetpgrp]);;
*) AC_MSG_ERROR([unexpected return status]);;
esac
trap - TTOU > /dev/null 2>&1 || :
;;
xyes) :;;
xno) AC_DEFINE(BROKEN_TCSETPGRP);;
*) AC_MSG_ERROR([unexpected value zsh_working_tcsetpgrp=$zsh_working_tcsetpgrp]);;
esac
fi
dnl -----------
dnl test for faked getpwnam() entry, ie a single entry returned for any username
dnl for instance, BeOS R4.51 is not multiuser yet, and fakes getpwnam()
dnl test by looking up two usernames that shouldn't succeed, and compare entry
dnl -----------
AH_TEMPLATE([GETPWNAM_FAKED],
[Define to 1 if getpwnam() is faked, ie BeOS R4.51.])
if test x$ac_cv_func_getpwnam = xyes; then
AC_CACHE_CHECK(if getpwnam() is faked,
zsh_cv_sys_getpwnam_faked,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pwd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
struct passwd *pw1, *pw2;
char buf[1024], name[1024];
sprintf(buf, "%d:%d", getpid(), rand());
pw1=getpwnam(buf);
if (pw1) strcpy(name, pw1->pw_name);
sprintf(buf, "%d:%d", rand(), getpid());
pw2=getpwnam(buf);
return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
}
]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])])
if test x$zsh_cv_sys_getpwnam_faked = xyes; then
AC_DEFINE(GETPWNAM_FAKED)
fi
fi
dnl ---------------
dnl check for the type of third argument of accept
dnl ---------------
@ -3151,9 +2989,6 @@ AH_TOP([/***** begin user configuration section *****/
/* Define to 1 if you want user names to be cached */
#define CACHE_USERNAMES 1
/* Define to 1 if system supports job control */
#define JOB_CONTROL 1
/* Define this if you use "suspended" instead of "stopped" */
#define USE_SUSPENDED 1