Annotation of pkgsrc/sysutils/socket/patches/patch-aa, revision 1.2

1.1       tron        1: --- Makefile.orig      Thu Sep 10 16:59:31 1992
1.2     ! tron        2: +++ Makefile   Tue Feb 24 01:36:50 1998
        !             3: @@ -8,7 +8,7 @@
        !             4:  ### socket.1 in /usr/local/man/man1/socket.1
        !             5:  ### Make sure the target directories exist before doing a "make install".
        !             6:  
        !             7: -INSTALLBASE = /usr/local
        !             8: +INSTALLBASE = ${PREFIX}
        !             9:  INSTALLBINPATH = $(INSTALLBASE)/bin
        !            10:  INSTALLBINMODE = 755
        !            11:  INSTALLMANPATH = $(INSTALLBASE)/man
1.1       tron       12: @@ -43,7 +43,8 @@
                     13:  ### CDC 4680 EP/IX: (I know it *has* setsid(2), but not with bsd43)
                     14:  # SWITCHES = -systype bsd43 -DNOSETSID
                     15:  
                     16: -
                     17: +# FreeBSD 2.x (4.4BSD)
                     18: +SWITCHES=-DHAVE_SYS_PARAM_H -Wall
                     19:  
                     20:  ### It should not be necessary to change anything below this line.
                     21:  ##################################################################
                     22: --- README.orig        Wed Sep  9 16:45:16 1992
                     23: +++ README     Wed Aug 14 16:57:58 1996
                     24: @@ -166,4 +166,4 @@
                     25:      1000 Berlin 10
                     26:      Germany
                     27:  
                     28: -    <nickel@cs.tu-berlin.de>
                     29: +Juergen Nickelsen <jn@berlin.snafu.de>
                     30: --- globals.h.orig     Sun Aug 30 21:04:27 1992
                     31: +++ globals.h  Wed Aug 14 16:57:58 1996
                     32: @@ -8,6 +8,11 @@
                     33:  */
                     34:  
                     35:  #include "patchlevel.h"
                     36: + 
                     37: +#if HAVE_SYS_PARAM_H
                     38: +# include <sys/param.h>
                     39: +#endif
                     40: +
                     41:  
                     42:  /* globals for socket */
                     43:  
                     44: @@ -49,4 +54,7 @@
                     45:  extern int crlfflag ;
                     46:  extern int active_socket ;
                     47:  extern char *progname ;
                     48: -extern char *sys_errlist[], *sys_siglist[] ;
                     49: +
                     50: +#if !(defined(BSD) && (BSD >=199306))
                     51: +     extern char *sys_errlist[], *sys_siglist[] ;
                     52: +#endif
                     53: --- io.c.orig  Sun Aug 30 19:15:26 1992
                     54: +++ io.c       Wed Aug 14 16:57:58 1996
                     55: @@ -16,6 +16,8 @@
                     56:  #endif
                     57:  #include <errno.h>
                     58:  #include <stdio.h>
                     59: +#include <string.h>
                     60: +#include <unistd.h>
                     61:  #include "globals.h"
                     62:  
                     63:  /* read from from, write to to. select(2) has returned, so input
                     64: @@ -90,7 +92,7 @@
                     65:  
                     66:  /* all IO to and from the socket is handled here. The main part is
                     67:   * a loop around select(2). */
                     68: -do_io()
                     69: +void do_io()
                     70:  {
                     71:      fd_set readfds ;
                     72:      int fdset_width ;
                     73: --- siglist.c.orig     Sun Aug 30 15:50:48 1992
                     74: +++ siglist.c  Wed Aug 14 16:57:58 1996
                     75: @@ -32,12 +32,18 @@
                     76:  #  endif /* !_NSIG */
                     77:  #endif /* !NSIG */
                     78:  
                     79: -char *sys_siglist[NSIG];
                     80: +#if HAVE_SYS_PARAM_H
                     81: +# include <sys/param.h>
                     82: +#endif
                     83:  
                     84: +#if !(defined(BSD) && (BSD >=199306))
                     85: +char *sys_siglist[NSIG];
                     86: +#endif
                     87:  extern *malloc ();
                     88:  
                     89: -initialize_siglist ()
                     90: +void initialize_siglist ()
                     91:  {
                     92: +#if !(defined(BSD) && (BSD >=199306))
                     93:    register int i;
                     94:  
                     95:    for (i = 0; i < NSIG; i++)
                     96: @@ -219,4 +225,5 @@
                     97:          sprintf (sys_siglist[i], "Unknown Signal #%d", i);
                     98:        }
                     99:      }
                    100: +#endif /* !(defined(BSD) && (BSD >=199306)) */
                    101:  }
                    102: --- socket.1.orig      Wed Sep  9 16:38:19 1992
                    103: +++ socket.1   Wed Aug 14 16:57:58 1996
                    104: @@ -158,4 +158,4 @@
                    105:  .SH VERSION
                    106:  This manual page describes Socket\-1.1.
                    107:  .SH AUTHOR
                    108: -Juergen Nickelsen <nickel@cs.tu-berlin.de>
                    109: +Juergen Nickelsen <jn@berlin.snafu.de>
                    110: --- socket.c.orig      Wed Sep  9 16:14:34 1992
                    111: +++ socket.c   Wed Aug 14 16:57:59 1996
                    112: @@ -18,6 +18,8 @@
                    113:  #else
                    114:  #include <string.h>
                    115:  #endif
                    116: +#include <stdlib.h>
                    117: +#include <unistd.h>
                    118:  #include "globals.h"
                    119:  
                    120:  /* global variables */
                    121: @@ -37,6 +39,8 @@
                    122:  void server A((int port, char *service_name)) ;
                    123:  void handle_server_connection A((void)) ;
                    124:  void client A((char *host, int port, char *service_name)) ;
                    125: +extern void init_signals A((void)) ;
                    126: +extern void do_io A((void)) ;
                    127:  
                    128:  int main(argc, argv)
                    129:  int argc ;
                    130: @@ -46,7 +50,7 @@
                    131:      int opt ;                 /* option character */
                    132:      int error = 0 ;           /* usage error occurred */
                    133:      extern int optind ;               /* from getopt() */
                    134: -    char *host ;              /* name of remote host */
                    135: +    /* char *host ; */                /* name of remote host */
                    136:      int port ;                        /* port number for socket */
                    137:      char *service_name ;      /* name of service for port */
                    138:  
                    139: @@ -58,7 +62,7 @@
                    140:  
                    141:      /* set up progname for later use */
                    142:      progname = argv[0] ;
                    143: -    if (cp = strrchr(progname, '/')) progname = cp + 1 ;
                    144: +    if ((cp = strrchr(progname, '/'))) progname = cp + 1 ;
                    145:  
                    146:      /* parse options */
                    147:      while ((opt = getopt(argc, argv, "bcflp:qrsvw?")) != -1) {
                    148: @@ -185,15 +189,15 @@
                    149:                long norder ;
                    150:                char dotted[20] ;
                    151:  
                    152: -              he = gethostbyaddr(&sa.sin_addr.s_addr,
                    153: +              he = gethostbyaddr((char *)&sa.sin_addr.s_addr,
                    154:                                   sizeof(sa.sin_addr.s_addr), AF_INET) ;
                    155:                if (!he) {
                    156:                    norder = htonl(sa.sin_addr.s_addr) ;
                    157:                    sprintf(dotted, "%d.%d.%d.%d",
                    158: -                          (norder >> 24) & 0xff,
                    159: -                          (norder >> 16) & 0xff,
                    160: -                          (norder >>  8) & 0xff,
                    161: -                          norder & 0xff) ;
                    162: +                          (int)((norder >> 24) & 0xff),
                    163: +                          (int)((norder >> 16) & 0xff),
                    164: +                          (int)((norder >>  8) & 0xff),
                    165: +                          (int)(norder & 0xff)) ;
                    166:                }
                    167:                fprintf(stderr, "connection from %s\n",
                    168:                        (he ? he->h_name : dotted)) ;
                    169: --- socketp.c.orig     Sun Aug  9 03:41:42 1992
                    170: +++ socketp.c  Wed Aug 14 16:57:59 1996
                    171: @@ -11,10 +11,16 @@
                    172:  #include <sys/socket.h>
                    173:  #include <sys/errno.h>
                    174:  #include <netinet/in.h>
                    175: +#include <arpa/inet.h>
                    176:  #include <netdb.h>
                    177:  #include <stdio.h>
                    178: +#include <stdlib.h>
                    179: +#include <string.h>
                    180: +#include <unistd.h>
                    181:  #include "globals.h"
                    182:  
                    183: +extern int is_number A((char *));
                    184: +
                    185:  /*
                    186:   * create a server socket on PORT accepting QUEUE_LENGTH connections
                    187:   */
                    188: @@ -52,7 +58,7 @@
                    189:  {
                    190:      struct sockaddr_in sa ;
                    191:      struct hostent *hp ;
                    192: -    int a, s ;
                    193: +    int s ;
                    194:      long addr ;
                    195:  
                    196:  
                    197: @@ -76,7 +82,7 @@
                    198:      if ((s = socket(sa.sin_family, SOCK_STREAM, 0)) < 0) { /* get socket */
                    199:        return -1 ;
                    200:      }
                    201: -    if (connect(s, &sa, sizeof(sa)) < 0) {                  /* connect */
                    202: +    if (connect(s, (struct sockaddr *)&sa, sizeof(sa)) < 0) { /* connect */
                    203:        close(s) ;
                    204:        return -1 ;
                    205:      }
                    206: --- utils.c.orig       Wed Sep  9 16:31:16 1992
                    207: +++ utils.c    Wed Aug 14 16:57:59 1996
                    208: @@ -25,8 +25,10 @@
                    209:  #else
                    210:  #include <sys/resource.h>
                    211:  #endif
                    212: +#include <unistd.h>
                    213:  #include "globals.h"
                    214:  
                    215: +extern void initialize_siglist A((void)) ;
                    216:  
                    217:  /* Signal handler, print message and exit */
                    218:  SIG_HANDLER_RET exitsig(sig)
                    219: @@ -70,7 +72,7 @@
                    220:  
                    221:  /* set up signal handling. All except TSTP, CONT, CLD, and QUIT
                    222:   * are caught with exitsig(). */
                    223: -init_signals()
                    224: +void init_signals()
                    225:  {
                    226:      int i ;
                    227:  #ifdef SIG_SETMASK            /* only with BSD signals */

CVSweb <webmaster@jp.NetBSD.org>