--- nettoe-1.1.0.orig/src/network.c +++ nettoe-1.1.0/src/network.c @@ -23,6 +23,7 @@ int establish_listening_socket (unsigned short port_number, char peer_ip_address[20]) { int sockfd, new_fd; + int reuse = 1; int sin_size; int BACKLOG = 2; struct sockaddr_in my_addr; @@ -40,18 +41,21 @@ exit (1); } + /* avoid "Address already in use" errors when restarting */ + if (setsockopt (sockfd, SOL_SOCKET, SO_REUSEADDR, (void *) &reuse, sizeof (reuse)) == -1) + { + perror ("SO_REUSEADDR"); + fprintf (stderr, "Peer error: (SO_REUSEADDR). Quitting...\n\n"); + exit (1); + } + if (bind (sockfd, (struct sockaddr *) &my_addr, sizeof (struct sockaddr)) == -1) { - /* perror ("bind"); */ + perror ("bind"); printf("\n##########################################################\n"); printf("# NETWORK ERROR: #\n"); printf("# (bind: address already in use or permission is denied).#\n"); - printf("# #\n"); - printf ("# INFOS: #\n"); - printf("# This often happens when the ports used by netToe to #\n"); - printf ("# comunicate, are busy #\n"); - printf ("# Just wait a minute before running netToe again. #\n"); printf ("##########################################################\n"); printf ("Quitting...\n\n"); exit (1); --- nettoe-1.1.0.orig/debian/changelog +++ nettoe-1.1.0/debian/changelog @@ -0,0 +1,31 @@ +nettoe (1.1.0-2) unstable; urgency=low + + * QA upload. + * Package is orphaned (see #268125); set maintainer to Debian QA Group. + * src/network.c: Set SO_REUSEADDR to avoid `Address already in use' + errors when restarting. Closes: #227641. + * Switch to debhelper 4. + * debian/changelog: Remove obsolete Emacs local variables. + * debian/menu: Add quotes to placate Lintian. + * debian/rules: Honor DEB_BUILD_OPTIONS=noopt. + * Conforms to Standards version 3.6.2. + + -- Matej Vela Fri, 21 Oct 2005 11:58:40 +0200 + +nettoe (1.1.0-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Mon, 6 Aug 2001 22:22:47 +0200 + +nettoe (1.0.6-1) unstable; urgency=low + + * New upstream release. + + -- Andras Bali Sun, 1 Jul 2001 19:58:16 +0200 + +nettoe (1.0.5-1) unstable; urgency=low + + * Initial Release (Closes: #96202). + + -- Andras Bali Sat, 23 Jun 2001 22:24:49 +0200 --- nettoe-1.1.0.orig/debian/nettoe.menu +++ nettoe-1.1.0/debian/nettoe.menu @@ -0,0 +1,5 @@ +?package(nettoe):\ + needs="text"\ + section="Games/Board"\ + title="NetToe"\ + command="/usr/games/nettoe" --- nettoe-1.1.0.orig/debian/compat +++ nettoe-1.1.0/debian/compat @@ -0,0 +1 @@ +4 --- nettoe-1.1.0.orig/debian/watch +++ nettoe-1.1.0/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://prdownloads.sourceforge.net/nettoe/nettoe-(.*)\.tar\.gz debian uupdate --- nettoe-1.1.0.orig/debian/rules +++ nettoe-1.1.0/debian/rules @@ -0,0 +1,51 @@ +#!/usr/bin/make -f + +# `-Wall' is added by configure. +export CFLAGS := -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2) + +build: build-stamp +build-stamp: + dh_testdir + + ./configure --prefix=/usr --bindir=/usr/games --mandir=/usr/share/man + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) DESTDIR=$(CURDIR)/debian/nettoe install + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installmenu + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- nettoe-1.1.0.orig/debian/nettoe.docs +++ nettoe-1.1.0/debian/nettoe.docs @@ -0,0 +1,4 @@ +TO-DO +NEWS +README +BUGS --- nettoe-1.1.0.orig/debian/copyright +++ nettoe-1.1.0/debian/copyright @@ -0,0 +1,17 @@ +This package was debianized by Andras Bali on +Sat, 23 Jun 2001 22:24:49 +0200. + +It was downloaded from http://nettoe.sourceforge.net/downloads.php. + +Upstream Author: Gabriele Giorgetti + +Copyright: + +This software is written by Gabriele Giorgetti. + +You are free to distribute this software under the terms of +the GNU General Public License. + +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL file. + --- nettoe-1.1.0.orig/debian/control +++ nettoe-1.1.0/debian/control @@ -0,0 +1,15 @@ +Source: nettoe +Section: games +Priority: optional +Maintainer: Debian QA Group +Build-Depends: debhelper +Standards-Version: 3.6.2 + +Package: nettoe +Architecture: any +Depends: ${shlibs:Depends} +Description: Networked version of Tic Tac Toe for the console + NetToe is a console-based version of the classic game "Tic Tac Toe". + It's playable against computer AI, a player on the same machine or + with another player over the network. +