Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Oct 2016 03:55:09 +0000 (UTC)
From:      Ryan Steinmetz <zi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r424493 - in head/net/mosh: . files
Message-ID:  <201610230355.u9N3t9TO073823@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zi
Date: Sun Oct 23 03:55:09 2016
New Revision: 424493
URL: https://svnweb.freebsd.org/changeset/ports/424493

Log:
  - Fix connect under 11.x
  
  Obtained from:	upstream: 4ad131a55d5a82a044a0c62428d6a488a97b46bf

Added:
  head/net/mosh/files/
  head/net/mosh/files/patch-src_frontend_mosh-server.cc   (contents, props changed)
Modified:
  head/net/mosh/Makefile

Modified: head/net/mosh/Makefile
==============================================================================
--- head/net/mosh/Makefile	Sun Oct 23 00:02:02 2016	(r424492)
+++ head/net/mosh/Makefile	Sun Oct 23 03:55:09 2016	(r424493)
@@ -3,6 +3,7 @@
 
 PORTNAME=	mosh
 PORTVERSION=	1.2.6
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	http://mosh.mit.edu/ \
 		http://mirrors.rit.edu/zi/

Added: head/net/mosh/files/patch-src_frontend_mosh-server.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mosh/files/patch-src_frontend_mosh-server.cc	Sun Oct 23 03:55:09 2016	(r424493)
@@ -0,0 +1,55 @@
+--- src/frontend/mosh-server.cc.orig	2016-08-10 10:58:28 UTC
++++ src/frontend/mosh-server.cc
+@@ -409,7 +409,6 @@ static int run_server( const char *desir
+   }
+ 
+   printf( "\nMOSH CONNECT %s %s\n", network->port().c_str(), network->get_key().c_str() );
+-  fflush( stdout );
+ 
+   /* don't let signals kill us */
+   struct sigaction sa;
+@@ -421,25 +420,34 @@ static int run_server( const char *desir
+ 
+ 
+   /* detach from terminal */
++  fflush( stdout );
++  fflush( stderr );
+   pid_t the_pid = fork();
+   if ( the_pid < 0 ) {
+     perror( "fork" );
+   } else if ( the_pid > 0 ) {
+-    _exit( 0 );
+-  }
++    fprintf( stderr, "\nmosh-server (%s) [build %s]\n", PACKAGE_STRING, BUILD_VERSION );
++    fprintf( stderr, "Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\n" );
++    fprintf( stderr, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n" );
+ 
+-  fprintf( stderr, "\nmosh-server (%s) [build %s]\n", PACKAGE_STRING, BUILD_VERSION );
+-  fprintf( stderr, "Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\n" );
+-  fprintf( stderr, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n" );
++    fprintf( stderr, "[mosh-server detached, pid = %d]\n", static_cast<int>(the_pid) );
++#ifndef HAVE_IUTF8
++    fprintf( stderr, "\nWarning: termios IUTF8 flag not defined.\nCharacter-erase of multibyte character sequence\nprobably does not work properly on this platform.\n" );
++#endif /* HAVE_IUTF8 */
+ 
+-  fprintf( stderr, "[mosh-server detached, pid = %d]\n", (int)getpid() );
++    fflush( stdout );
++    fflush( stderr );
++    if ( isatty( STDOUT_FILENO ) ) {
++      tcdrain( STDOUT_FILENO );
++    }
++    if ( isatty( STDERR_FILENO ) ) {
++      tcdrain( STDERR_FILENO );
++    }
++    _exit( 0 );
++  }
+ 
+   int master;
+ 
+-#ifndef HAVE_IUTF8
+-  fprintf( stderr, "\nWarning: termios IUTF8 flag not defined.\nCharacter-erase of multibyte character sequence\nprobably does not work properly on this platform.\n" );
+-#endif /* HAVE_IUTF8 */
+-
+   /* close file descriptors */
+   if ( !verbose ) {
+     /* Necessary to properly detach on old versions of sshd (e.g. RHEL/CentOS 5.0). */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610230355.u9N3t9TO073823>