pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/games/doomlegacy



Module Name:    pkgsrc
Committed By:   micha
Date:           Wed Jun 17 16:16:57 UTC 2020

Modified Files:
        pkgsrc/games/doomlegacy: Makefile distinfo
        pkgsrc/games/doomlegacy/patches: patch-src_mserv.c

Log Message:
games/doomlegacy: Build fix for SunOS

Use portable fcntl() instead of ioctl() for non-blocking mode of socket
(for all operating systems that are relevant for pkgsrc).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 pkgsrc/games/doomlegacy/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/games/doomlegacy/distinfo
cvs rdiff -u -r1.1 -r1.2 pkgsrc/games/doomlegacy/patches/patch-src_mserv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/games/doomlegacy/Makefile
diff -u pkgsrc/games/doomlegacy/Makefile:1.6 pkgsrc/games/doomlegacy/Makefile:1.7
--- pkgsrc/games/doomlegacy/Makefile:1.6        Mon Jun 15 10:32:52 2020
+++ pkgsrc/games/doomlegacy/Makefile    Wed Jun 17 16:16:57 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.6 2020/06/15 10:32:52 micha Exp $
+# $NetBSD: Makefile,v 1.7 2020/06/17 16:16:57 micha Exp $
 
 VERS=                  1.48.4
 PKGNAME=               doomlegacy-${VERS}
-PKGREVISION=           1
+PKGREVISION=           2
 CATEGORIES=            games
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=doomlegacy/}
 DISTNAME=              ${PKGNAME_NOREV:S/-/_/}_source

Index: pkgsrc/games/doomlegacy/distinfo
diff -u pkgsrc/games/doomlegacy/distinfo:1.5 pkgsrc/games/doomlegacy/distinfo:1.6
--- pkgsrc/games/doomlegacy/distinfo:1.5        Mon Jun 15 10:32:52 2020
+++ pkgsrc/games/doomlegacy/distinfo    Wed Jun 17 16:16:57 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2020/06/15 10:32:52 micha Exp $
+$NetBSD: distinfo,v 1.6 2020/06/17 16:16:57 micha Exp $
 
 SHA1 (doomlegacy_1.48.4_common.zip) = 14aed4c0091e8c61f46a2303f9316659ab6c0483
 RMD160 (doomlegacy_1.48.4_common.zip) = cca61af6bdda1003032ee117129e07596c8bbfcf
@@ -12,7 +12,7 @@ SHA1 (patch-src_Makefile) = 65a6380a5d11
 SHA1 (patch-src_am__map.c) = 647bcba2374cfa7038646e0c053636b43caaf33a
 SHA1 (patch-src_doomdata.h) = 2fd95b5db154b05ba88597b20c45146339db4622
 SHA1 (patch-src_dstrings.c) = e1fc8bdcb83efa18690d95c56e3ea7c94a388a50
-SHA1 (patch-src_mserv.c) = cf90e57287523cc1d27c44a575008b078b195522
+SHA1 (patch-src_mserv.c) = 685ca5028740428ef2579025ca8673d8da526ebe
 SHA1 (patch-src_p__local.h) = e429f2ce5d60dd538bc5e796847b53ae72604b33
 SHA1 (patch-src_p__setup.c) = c3766f924b05655b8d9d17d4686dde9a83239e0a
 SHA1 (patch-src_r__defs.h) = 9211ae6db72f0288f38449b18c8c252f42686405

Index: pkgsrc/games/doomlegacy/patches/patch-src_mserv.c
diff -u pkgsrc/games/doomlegacy/patches/patch-src_mserv.c:1.1 pkgsrc/games/doomlegacy/patches/patch-src_mserv.c:1.2
--- pkgsrc/games/doomlegacy/patches/patch-src_mserv.c:1.1       Mon Jun 15 10:32:52 2020
+++ pkgsrc/games/doomlegacy/patches/patch-src_mserv.c   Wed Jun 17 16:16:57 2020
@@ -1,17 +1,54 @@
-$NetBSD: patch-src_mserv.c,v 1.1 2020/06/15 10:32:52 micha Exp $
+$NetBSD: patch-src_mserv.c,v 1.2 2020/06/17 16:16:57 micha Exp $
 
 Use native inet_aton() on Solaris.
+Use portable fcntl() instead of ioctl() for non-blocking mode by default.
 
---- src/mserv.c.orig   2020-05-10 22:05:17.000000000 +0000
+--- src/mserv.c.orig   2020-06-16 09:17:35.000000000 +0000
 +++ src/mserv.c
-@@ -210,7 +210,9 @@ struct Copy_CVarMS_t
+@@ -122,12 +122,13 @@
+ #else
+ # include <unistd.h>
+ # ifdef __OS2__
+-#  include <sys/types.h>
++#  include <sys/types.h>  // [MB] 2020-06-16: Maybe required for old Unix too
+ # endif
+ # include <sys/socket.h>  // socket(),...
+ # include <sys/time.h>    // timeval,... (TIMEOUT)
+ # include <netinet/in.h>  // sockaddr_in
+ # include <arpa/inet.h>   // inet_addr(),...
++# include <fcntl.h>       // [MB] 2020-06-16: For fcntl()
+ # include <netdb.h>       // gethostbyname(),...
+ # include <sys/ioctl.h>
+ # include <errno.h>
+@@ -210,7 +211,9 @@ struct Copy_CVarMS_t
  #define close closesocket
  #endif
  
 -#if defined( WIN32) || defined( __OS2__) || defined( SOLARIS)
-+// For pkgsrc: Use native inet_aton() on Solaris
++// [MB] 2020-06-16: Use native inet_aton() on Solaris
 +// Solaris has inet_aton() in libresolv since version 2.6 from 1997
 +#if defined( WIN32) || defined( __OS2__) // || defined( SOLARIS)
  // it seems windows doesn't define that... maybe some other OS? OS/2
  static inline
  int inet_aton(const char *hostname,
+@@ -643,9 +646,19 @@ static int MS_Connect(char *ip_addr, cha
+         // winsock.h:  int ioctlsocket(SOCKET,long,u_long *);
+         u_long test = 1; // [smite] I have no idea what this type is supposed to be
+         ioctlsocket(ms_socket_fd, FIONBIO, &test);
+-#else
++#elif defined(__OS2__)
+         res = 1;  // non-blocking true
+         ioctl(ms_socket_fd, FIONBIO, &res);
++#else
++        // [MB] 2020-06-16: Use portable POSIX way to enable non-blocking mode
++        // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
++        res = fcntl(ms_socket_fd, F_SETFL, O_NONBLOCK);
++        if(-1 == res)
++        {
++            con_state = MSCS_FAILED;
++            MS_Close_socket();
++            return MS_CONNECT_ERROR;
++        }
+ #endif
+         res = connect(ms_socket_fd, (struct sockaddr *) &ms_addr, sizeof(ms_addr));
+         if (res < 0)



Home | Main Index | Thread Index | Old Index