Completata sezione sulla risoluzione di nomi ed indirizzi, iniziato a
[gapil.git] / sources / TCP_echod_third.c
index 86c154fd947226bc75ab0714ccdce0ae4ae36605..689049265861498279830c4fe0626f8ff22ac9c8 100644 (file)
@@ -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 */