[Pkg-privacy-commits] [onioncat] 161/241: introduced fork/pthreads workaround for blocking IO on OpenBSD

Intrigeri intrigeri at moszumanska.debian.org
Wed Aug 26 16:16:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch upstream-master
in repository onioncat.

commit 964d400b756064f0936f1310cb06a568cee3e56b
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date:   Sat Feb 21 17:59:41 2009 +0000

    introduced fork/pthreads workaround for blocking IO on OpenBSD
    
    git-svn-id: https://www.cypherpunk.at/svn/onioncat/trunk@473 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
 configure       | 22 +++++++++++-----------
 src/ocat.c      |  2 +-
 src/ocatroute.c |  7 ++++++-
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index 99e4cbf..bf9fe12 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for onioncat 0.1.10-471M.
+# Generated by GNU Autoconf 2.61 for onioncat 0.1.10-472M.
 #
 # Report bugs to <rahra at cypherpunk.at>.
 #
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='onioncat'
 PACKAGE_TARNAME='onioncat'
-PACKAGE_VERSION='0.1.10-471M'
-PACKAGE_STRING='onioncat 0.1.10-471M'
+PACKAGE_VERSION='0.1.10-472M'
+PACKAGE_STRING='onioncat 0.1.10-472M'
 PACKAGE_BUGREPORT='rahra at cypherpunk.at'
 
 # Factoring default headers for most tests.
@@ -1206,7 +1206,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures onioncat 0.1.10-471M to adapt to many kinds of systems.
+\`configure' configures onioncat 0.1.10-472M to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1272,7 +1272,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of onioncat 0.1.10-471M:";;
+     short | recursive ) echo "Configuration of onioncat 0.1.10-472M:";;
    esac
   cat <<\_ACEOF
 
@@ -1362,7 +1362,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-onioncat configure 0.1.10-471M
+onioncat configure 0.1.10-472M
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1376,7 +1376,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by onioncat $as_me 0.1.10-471M, which was
+It was created by onioncat $as_me 0.1.10-472M, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2066,7 +2066,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='onioncat'
- VERSION='0.1.10-471M'
+ VERSION='0.1.10-472M'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2217,7 +2217,7 @@ ac_config_headers="$ac_config_headers config.h"
 
 
 cat >>confdefs.h <<\_ACEOF
-#define SVN_REVISION "471M"
+#define SVN_REVISION "472M"
 _ACEOF
 
 
@@ -5300,7 +5300,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by onioncat $as_me 0.1.10-471M, which was
+This file was extended by onioncat $as_me 0.1.10-472M, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5353,7 +5353,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-onioncat config.status 0.1.10-471M
+onioncat config.status 0.1.10-472M
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/src/ocat.c b/src/ocat.c
index b436a2a..ebd119b 100644
--- a/src/ocat.c
+++ b/src/ocat.c
@@ -124,7 +124,7 @@ void background(void)
          log_debug("parent [%d] exits, background pid = %d", getpid(), pid);
          if (CNF(logf))
             fclose(CNF(logf));
-         exit(0);
+         _exit(0);
    }
 }
 
diff --git a/src/ocatroute.c b/src/ocatroute.c
index 6f2ccc7..33ef8cc 100644
--- a/src/ocatroute.c
+++ b/src/ocatroute.c
@@ -789,7 +789,12 @@ void packet_forwarder(void)
       if (term_req())
          break;
 
-     if ((rlen = read(CNF(tunfd[0]), buf, FRAME_SIZE)) == -1)
+#ifdef __OpenBSD__
+      // workaround for OpenBSD userland threads
+      fcntl(CNF(tunfd[0]), F_SETFL, fcntl(CNF(tunfd[0]), F_GETFL) & ~O_NONBLOCK);
+#endif
+      log_debug("reading from tunfd[0] = %d", CNF(tunfd[0]));
+      if ((rlen = read(CNF(tunfd[0]), buf, FRAME_SIZE)) == -1)
       {
          rlen = errno;
          log_debug("read from tun %d returned on error: \"%s\"", CNF(tunfd[0]), strerror(rlen));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git



More information about the Pkg-privacy-commits mailing list