Changeset 5014 in project for unix-sockets/unix-sockets.scm


Ignore:
Timestamp:
07/12/07 01:54:49 (13 years ago)
Author:
felix winkelmann
Message:

new fp release (tagged)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • unix-sockets/unix-sockets.scm

    r852 r5014  
    6262{
    6363  int sock;
    64   size_t size;
     64  socklen_t size;
    6565     
    6666  /* Create the socket. */
     
    8787{
    8888  int sock;
     89  socklen_t size;
    8990     
    9091  /* Create the socket. */
     
    9697  strncpy(socket_name.sun_path, filename, sizeof(socket_name.sun_path));
    9798  socket_name.sun_path[sizeof (socket_name.sun_path) - 1] = '\0';
     99  size = SUN_LEN(&socket_name);
    98100
    99101  /* Connect to the server. */
    100   if (connect(sock, (struct sockaddr *) &socket_name, strlen(socket_name.sun_path) + sizeof(socket_name.sun_family)) < 0)
     102  if (connect(sock, (struct sockaddr *) &socket_name, size) < 0)
    101103    return -1;
    102104
     
    108110accept_connection(int sock, char *filename)
    109111{
    110   int s2, size;
    111 
    112   size = sizeof(socket_name);
     112  int s2;
     113  socklen_t size;
     114
    113115  socket_name.sun_family = AF_LOCAL;
    114116  strncpy(socket_name.sun_path, filename, sizeof(socket_name.sun_path));
    115117  socket_name.sun_path[sizeof (socket_name.sun_path) - 1] = '\0';
     118  size = SUN_LEN(&socket_name);
    116119  s2 = accept(sock, (struct sockaddr *)&socket_name, &size);
    117120
Note: See TracChangeset for help on using the changeset viewer.