X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FTCP_echod_third.c;h=689049265861498279830c4fe0626f8ff22ac9c8;hp=86c154fd947226bc75ab0714ccdce0ae4ae36605;hb=1bc54870307368cc8c74e07f7f4dd53498e09db0;hpb=8654ce33b450ae7bb34c3907835000a0760c2931 diff --git a/sources/TCP_echod_third.c b/sources/TCP_echod_third.c index 86c154f..6890492 100644 --- a/sources/TCP_echod_third.c +++ b/sources/TCP_echod_third.c @@ -1,4 +1,4 @@ -/* TCP_echod_third.c +/* TCP_echod.c * * Copyright (C) 2001-2004 Simone Piccardi * @@ -20,7 +20,6 @@ * * Program echod * Elementary TCP server for echo service (port 7) - * Third version, use sockbind * * Author: Simone Piccardi * Jun. 2001 @@ -117,8 +116,7 @@ int main(int argc, char *argv[]) SignalRestart(SIGCHLD, HandSigCHLD); /* restarting handler */ } /* create and bind socket */ - if ( (list_fd = sockbind(argv[optind], "echo", 6, SOCK_STREAM)) < 0) { - if (errno) perror("Socket creation error"); + if ( (list_fd = sockbind(NULL, "echo", 6, SOCK_STREAM)) < 0) { return 1; } /* release privileges and go daemon */