From d4c14b8e4d524dc4514b2c0a2e552f157e562ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 17 Jul 2017 15:52:00 +0200 Subject: [PATCH 1/7] add dirent.h test back to configure --- src/configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/configure.ac b/src/configure.ac index 9e46f00..0cdb199 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -85,6 +85,9 @@ dnl AC_CHECK_HEADERS(langinfo.h) dnl +AC_CHECK_HEADERS(dirent.h) + +dnl dnl Check user changeable stuff dnl -- 2.7.0 From b9a8a260fd996b540cf785ce248875a7d59756de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 17 Jul 2017 15:52:54 +0200 Subject: [PATCH 2/7] remove hardcoded -lutil AC_SEARCH_LIBS prepends the found lib already. --- src/configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/src/configure.ac b/src/configure.ac index 0cdb199..069c261 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -76,7 +76,6 @@ dnl AC_CHECK_HEADERS(pty.h util.h libutil.h) AC_SEARCH_LIBS([openpty], [util openpty], [ AC_DEFINE(HAVE_OPENPTY) - LIBS="$LIBS -lutil" ], [ AC_MSG_ERROR([unable to find openpty() function]) ]) -- 2.7.0 From d5b66363fd030051f9d9fe2609f513df5647db5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 17 Jul 2017 15:53:45 +0200 Subject: [PATCH 3/7] fix mismatched types in prototype not everyone defines pid_t as int... --- src/display.h | 2 +- src/screen.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display.h b/src/display.h index 967585c..d29abad 100644 --- a/src/display.h +++ b/src/display.h @@ -307,7 +307,7 @@ do \ } \ while (0) -Display *MakeDisplay (char *, char *, char *, int, int, struct mode *); +Display *MakeDisplay (char *, char *, char *, int, pid_t, struct mode *); void FreeDisplay (void); void DefProcess (char **, size_t *); void DefRedisplayLine (int, int, int, int); diff --git a/src/screen.h b/src/screen.h index 1dd4fb2..b1cd577 100644 --- a/src/screen.h +++ b/src/screen.h @@ -220,7 +220,7 @@ void SigHup (int); void eexit (int) __attribute__((__noreturn__)); void Detach (int); void Hangup (void); -void Kill (int, int); +void Kill (pid_t, int); void Msg (int, const char *, ...) __attribute__((format(printf, 2, 3))); void Panic (int, const char *, ...) __attribute__((format(printf, 2, 3))) __attribute__((__noreturn__)); void QueryMsg (int, const char *, ...) __attribute__((format(printf, 2, 3))); -- 2.7.0 From 2242916e8c18e6883f1a8d0a1bb98188314e50d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 20 Jun 2014 17:16:37 +0200 Subject: [PATCH 4/7] Haiku port: Check for some libraries * libnetwork for sockets, * libbsd for getpass. --- src/configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/configure.ac b/src/configure.ac index 069c261..dd22c1b 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -74,7 +74,7 @@ AC_SEARCH_LIBS([crypt], [crypt], [], [ dnl AC_CHECK_HEADERS(pty.h util.h libutil.h) -AC_SEARCH_LIBS([openpty], [util openpty], [ +AC_SEARCH_LIBS([openpty], [util openpty bsd], [ AC_DEFINE(HAVE_OPENPTY) ], [ AC_MSG_ERROR([unable to find openpty() function]) @@ -195,6 +195,10 @@ AC_DEFINE_UNQUOTED(PTY_MODE, $with_pty_mode) dnl -- with_pty_group AC_DEFINE_UNQUOTED(PTY_GROUP, $with_pty_group) +AC_SEARCH_LIBS(socket, network) + +AC_CHECK_LIB(bsd, getpass) + dnl -- with_pty_rofs AS_IF([test "x$with_pty_rofs" == "xyes"], [ AC_DEFINE(PTY_ROFS) -- 2.7.0 From db40947a2526d8be1fd83ec6fa3165b3ca48fdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 24 Sep 2015 01:30:00 +0200 Subject: [PATCH 5/7] Haiku port: temporary workaround undefined TIOCCONS We should either implement it or do something else, really. --- src/tty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tty.c b/src/tty.c index cd4acb9..9258348 100644 --- a/src/tty.c +++ b/src/tty.c @@ -830,8 +830,10 @@ int TtyGrabConsole(int fd, bool on, char *rc_name) InitTTY(&new1, 0); SetMode(&new1, &new2, 0, 0); SetTTY(consredirfd[1], &new2); +#ifdef TIOCCONS if (UserContext() == 1) UserReturn(ioctl(consredirfd[1], TIOCCONS, (char *)&on)); +#endif if (UserStatus()) { Msg(errno, "%s: ioctl TIOCCONS failed", rc_name); close(consredirfd[0]); -- 2.7.0 From 7d985ccce374ad4a21a4f3b1acc6dd7268f1dc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 24 Sep 2015 01:30:42 +0200 Subject: [PATCH 6/7] define _NSIG as NSIG if not defined Neither seem to be part of POSIX, btw. --- src/attacher.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/attacher.c b/src/attacher.c index 684f56b..46638ab 100644 --- a/src/attacher.c +++ b/src/attacher.c @@ -45,6 +45,10 @@ #include #endif +#ifndef _NSIG +#define _NSIG NSIG +#endif + #include "misc.h" #include "socket.h" #include "tty.h" -- 2.7.0 From 0754ddf08ae65591b2236ab8441fcef16376e533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 24 Sep 2015 01:34:32 +0200 Subject: [PATCH 7/7] sched: actually calculate the nfds arg to select Some select() implementations don't like being called with higher nfds than actually set in the masks. --- src/sched.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sched.c b/src/sched.c index bd0048f..a1dea95 100644 --- a/src/sched.c +++ b/src/sched.c @@ -107,6 +107,7 @@ void sched() Event *timeoutev = 0; struct timeval timeout; int nsel; + int nfds; for (;;) { if (calctimeout) @@ -138,7 +139,15 @@ void sched() FD_SET(ev->fd, &w); } - nsel = select(FD_SETSIZE, &r, &w, (fd_set *) 0, timeoutev ? &timeout : (struct timeval *)0); + nfds = 1; + for (nsel = 0; nsel < FD_SETSIZE; nsel++) + if (FD_ISSET(nsel, &r)) + nfds = MAX(nfds, nsel + 1); + for (nsel = 0; nsel < FD_SETSIZE; nsel++) + if (FD_ISSET(nsel, &w)) + nfds = MAX(nfds, nsel + 1); + + nsel = select(nfds, &r, &w, (fd_set *) 0, timeoutev ? &timeout : (struct timeval *)0); if (nsel < 0) { if (errno != EINTR) { Panic(errno, "select"); -- 2.7.0