Changeset 5c1b3cd in mainline for uspace/app/netecho/netecho.c


Ignore:
Timestamp:
2013-03-16T21:48:33Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6b0cfa1
Parents:
71fe7e9d (diff), f597bc4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Mainline changes

File:
1 edited

Legend:

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

    r71fe7e9d r5c1b3cd  
    243243                if (verbose)
    244244                        printf("accept()\n");
    245                 socket_id = accept(listening_id, (void *) address_buf, &addrlen);
     245                socket_id = accept(listening_id, (void *) address_buf, &addrlen);
    246246                if (socket_id <= 0) {
    247247                        socket_print_error(stderr, socket_id, "Socket accept: ", "\n");
     
    312312                                rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen);
    313313                                if (rc != EOK)
    314                                         socket_print_error(stderr, rc, "Socket send: ", "\n");
     314                                        socket_print_error(stderr, rc, "Socket sendto: ", "\n");
    315315                        }
    316316                }
     
    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.