Changeset 9164c0c in mainline


Ignore:
Timestamp:
2013-03-14T17:16:34Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af076b4
Parents:
05bfce7
Message:

call bind() before listen()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/netecho/netecho.c

    r05bfce7 r9164c0c  
    394394                return listening_id;
    395395        }
    396 
     396       
     397        /* Bind the listening socket */
     398        rc = bind(listening_id, address, addrlen);
     399        if (rc != EOK) {
     400                socket_print_error(stderr, rc, "Socket bind: ", "\n");
     401                return rc;
     402        }
     403       
    397404        /* if the stream socket is used */
    398405        if (type == SOCK_STREAM) {
     
    402409                        backlog = 3;
    403410                }
    404 
     411               
    405412                /* Set the backlog */
    406413                rc = listen(listening_id, backlog);
     
    409416                        return rc;
    410417                }
    411         }
    412 
    413         /* Bind the listening socket */
    414         rc = bind(listening_id, address, addrlen);
    415         if (rc != EOK) {
    416                 socket_print_error(stderr, rc, "Socket bind: ", "\n");
    417                 return rc;
    418418        }
    419419
Note: See TracChangeset for help on using the changeset viewer.