Use posix_openpt() to open pty.

Drop obsolete pthread patch while here.
This commit is contained in:
naddy 2012-12-17 19:02:48 +00:00
parent 08607b4d02
commit 5331efe7ef
5 changed files with 73 additions and 45 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.36 2011/09/19 21:33:42 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.37 2012/12/17 19:02:48 naddy Exp $
COMMENT = VNC server for real X displays
DISTNAME = x11vnc-0.9.13
REVISION = 1
REVISION = 2
CATEGORIES = x11
HOMEPAGE = http://www.karlrunge.com/x11vnc/
@ -28,13 +28,16 @@ RUN_DEPENDS = devel/desktop-file-utils \
LIB_DEPENDS = graphics/jpeg \
net/avahi
CONFIGURE_STYLE = gnu
AUTOCONF_VERSION = 2.59
CONFIGURE_STYLE = autoconf
CONFIGURE_ARGS += ${CONFIGURE_SHARED} \
--with-x \
--with-avahi
CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
REORDER_DEPENDENCIES = ${FILESDIR}/automake.dep
pre-configure:
${SUBST_CMD} ${WRKSRC}/x11vnc/gui.c

View File

@ -0,0 +1,4 @@
# $OpenBSD: automake.dep,v 1.1 2012/12/17 19:02:48 naddy Exp $
rfbconfig.h.in configure.ac
rfbconfig.h.in aclocal.m4
/rfbconfig.h configure.ac

View File

@ -1,42 +0,0 @@
$OpenBSD: patch-configure,v 1.7 2011/09/15 20:27:29 sthen Exp $
--- configure.orig Wed Aug 10 23:35:10 2011
+++ configure Wed Sep 14 15:56:22 2011
@@ -8899,13 +8899,13 @@ fi
if test ! -z "$HAVE_PTHREAD_H"; then
-echo "$as_me:$LINENO: checking for pthread_mutex_lock in -lpthread" >&5
-echo $ECHO_N "checking for pthread_mutex_lock in -lpthread... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for pthread_mutex_lock in -pthread" >&5
+echo $ECHO_N "checking for pthread_mutex_lock in -pthread... $ECHO_C" >&6
if test "${ac_cv_lib_pthread_pthread_mutex_lock+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+LIBS="-pthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -8968,17 +8968,17 @@ if test $ac_cv_lib_pthread_pthread_mutex_lock = yes; t
#define HAVE_LIBPTHREAD 1
_ACEOF
- LIBS="-lpthread $LIBS"
+ LIBS="-pthread $LIBS"
fi
- echo "$as_me:$LINENO: checking for pthread_mutex_lock in -lpthread" >&5
-echo $ECHO_N "checking for pthread_mutex_lock in -lpthread... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for pthread_mutex_lock in -pthread" >&5
+echo $ECHO_N "checking for pthread_mutex_lock in -pthread... $ECHO_C" >&6
if test "${ac_cv_lib_pthread_pthread_mutex_lock+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+LIBS="-pthread $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-configure_ac,v 1.1 2012/12/17 19:02:48 naddy Exp $
--- configure.ac.orig Mon Dec 10 21:38:46 2012
+++ configure.ac Mon Dec 10 21:39:06 2012
@@ -777,7 +777,7 @@ fi
AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr])
# x11vnc only:
if test "$build_x11vnc" = "yes"; then
- AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent grantpt shmat])
+ AC_CHECK_FUNCS([setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid initgroups waitpid setutxent posix_openpt grantpt shmat])
fi
# check, if shmget is in cygipc.a

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-x11vnc_unixpw_c,v 1.1 2012/12/17 19:02:48 naddy Exp $
--- x11vnc/unixpw.c.orig Thu Aug 11 00:31:32 2011
+++ x11vnc/unixpw.c Mon Dec 10 21:59:46 2012
@@ -85,13 +85,6 @@ extern char *crypt(const char*, const char *);
#include <sys/stropts.h>
#endif
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
-#define IS_BSD
-#endif
-#if (defined(__MACH__) && defined(__APPLE__))
-#define IS_BSD
-#endif
-
int white_pixel(void);
void unixpw_screen(int init);
void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init);
@@ -522,6 +515,9 @@ char *get_pty_ptmx(int *fd_p) {
#if LIBVNCSERVER_HAVE_GRANTPT
+#if LIBVNCSERVER_HAVE_POSIX_OPENPT
+ fd = posix_openpt(O_RDWR|O_NOCTTY);
+#else
for (i=0; i < ndevs; i++) {
#ifdef O_NOCTTY
fd = open(devs[i], O_RDWR|O_NOCTTY);
@@ -532,6 +528,7 @@ char *get_pty_ptmx(int *fd_p) {
break;
}
}
+#endif
if (fd < 0) {
rfbLogPerror("open /dev/ptmx");
@@ -625,15 +622,11 @@ char *get_pty(int *fd_p) {
if (getenv("BSD_PTY")) {
return get_pty_loop(fd_p);
}
-#ifdef IS_BSD
- return get_pty_loop(fd_p);
-#else
#if LIBVNCSERVER_HAVE_GRANTPT
used_get_pty_ptmx = 1;
return get_pty_ptmx(fd_p);
#else
return get_pty_loop(fd_p);
-#endif
#endif
}