mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-17 09:10:08 +02:00
216 lines
5.6 KiB
Plaintext
216 lines
5.6 KiB
Plaintext
From 5d5125c8ae00e1f357a4e71fcd743a9cbd447f99 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
Date: Fri, 20 Jun 2014 17:16:37 +0200
|
|
Subject: [PATCH 1/7] Haiku port: Check for some libraries
|
|
|
|
* libnetwork for sockets,
|
|
* libbsd for getpass.
|
|
---
|
|
src/configure.ac | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/configure.ac b/src/configure.ac
|
|
index 1a75020..32e70c1 100644
|
|
--- a/src/configure.ac
|
|
+++ b/src/configure.ac
|
|
@@ -460,7 +460,9 @@ AC_TRY_LINK([
|
|
#include <langinfo.h>
|
|
],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no))
|
|
|
|
-AC_SEARCH_LIBS(gethostname, nsl)
|
|
+AC_SEARCH_LIBS(gethostname, nsl network)
|
|
+
|
|
+AC_CHECK_LIB(bsd, getpass)
|
|
|
|
AC_CHECK_FUNCS(vsnprintf strftime)
|
|
|
|
--
|
|
2.2.2
|
|
|
|
|
|
From 7bb5fac13c66db7d08ba64644e84616f9e0e90bf Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
Date: Fri, 20 Jun 2014 17:18:32 +0200
|
|
Subject: [PATCH 2/7] Haiku port: temporary workaround for missing utmp
|
|
|
|
---
|
|
src/acconfig.h | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/acconfig.h b/src/acconfig.h
|
|
index 656e117..85f7e8e 100644
|
|
--- a/src/acconfig.h
|
|
+++ b/src/acconfig.h
|
|
@@ -99,7 +99,9 @@
|
|
* If screen is installed with permissions to update /etc/utmp (such
|
|
* as if it is installed set-uid root), define UTMPOK.
|
|
*/
|
|
-#define UTMPOK
|
|
+#ifndef __HAIKU__
|
|
+# define UTMPOK
|
|
+#endif
|
|
|
|
/* Set LOGINDEFAULT to one (1)
|
|
* if you want entries added to /etc/utmp by default, else set it to
|
|
--
|
|
2.2.2
|
|
|
|
|
|
From 10ed906797cfefcc86d64f332f27353e971cce58 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
Date: Thu, 24 Sep 2015 01:28:59 +0200
|
|
Subject: [PATCH 3/7] configure.in: drop test on $posix which is not set
|
|
anymore
|
|
|
|
---
|
|
src/configure.ac | 2 --
|
|
1 file changed, 2 deletions(-)
|
|
|
|
diff --git a/src/configure.ac b/src/configure.ac
|
|
index 32e70c1..dc1e827 100644
|
|
--- a/src/configure.ac
|
|
+++ b/src/configure.ac
|
|
@@ -438,9 +438,7 @@ dnl
|
|
if test -z "$butterfly"; then
|
|
AC_CHECKING(for termio or termios)
|
|
AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
|
|
-if test -n "$posix"; then
|
|
AC_TRY_CPP([#include <termios.h>], AC_DEFINE(TERMIO))
|
|
-fi
|
|
)
|
|
fi
|
|
|
|
--
|
|
2.2.2
|
|
|
|
|
|
From be47c3c666aeb0d011df42414d91c75ae75e4d1e Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
Date: Thu, 24 Sep 2015 01:29:12 +0200
|
|
Subject: [PATCH 4/7] configure.in: fix libnetwork test for Haiku
|
|
|
|
gethostname is actually in libroot so won't bring libnetwork in.
|
|
---
|
|
src/configure.ac | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/configure.ac b/src/configure.ac
|
|
index dc1e827..e463484 100644
|
|
--- a/src/configure.ac
|
|
+++ b/src/configure.ac
|
|
@@ -458,7 +458,8 @@ AC_TRY_LINK([
|
|
#include <langinfo.h>
|
|
],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no))
|
|
|
|
-AC_SEARCH_LIBS(gethostname, nsl network)
|
|
+AC_SEARCH_LIBS(gethostname, nsl)
|
|
+AC_SEARCH_LIBS(socket, network)
|
|
|
|
AC_CHECK_LIB(bsd, getpass)
|
|
|
|
--
|
|
2.2.2
|
|
|
|
|
|
From 46fc9b17c2a6d1ffc1ca3f5e723b075a39de373c Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
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 1e2debb..8f3fa16 100644
|
|
--- a/src/tty.c
|
|
+++ b/src/tty.c
|
|
@@ -832,8 +832,10 @@ int TtyGrabConsole(int fd, int 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.2.2
|
|
|
|
|
|
From 06ff2ea9d27451b9cf086c075b0d2cb91d9f2bd6 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
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 5fbf444..bcf6b40 100644
|
|
--- a/src/attacher.c
|
|
+++ b/src/attacher.c
|
|
@@ -42,6 +42,10 @@
|
|
#include <security/pam_appl.h>
|
|
#endif
|
|
|
|
+#ifndef _NSIG
|
|
+#define _NSIG NSIG
|
|
+#endif
|
|
+
|
|
#include "misc.h"
|
|
#include "socket.h"
|
|
#include "tty.h"
|
|
--
|
|
2.2.2
|
|
|
|
|
|
From ce083e275a8153c5845e3ba39fc7269102049c40 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
|
|
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 0c3053d..60ae5f5 100644
|
|
--- a/src/sched.c
|
|
+++ b/src/sched.c
|
|
@@ -105,6 +105,7 @@ void sched()
|
|
Event *timeoutev = 0;
|
|
struct timeval timeout;
|
|
int nsel;
|
|
+ int nfds;
|
|
|
|
for (;;) {
|
|
if (calctimeout)
|
|
@@ -136,7 +137,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.2.2
|
|
|