[netperf-dev] netperf4 commit notice r16 - trunk/src

raj at netperf.org raj at netperf.org
Fri Nov 11 11:54:25 PST 2005


Author: raj
Date: 2005-11-11 11:54:23 -0800 (Fri, 11 Nov 2005)
New Revision: 16

Modified:
   trunk/src/netmsg.c
   trunk/src/netperf.c
   trunk/src/netserver.c
Log:
Fix warnings with the new uses of __func__


Modified: trunk/src/netmsg.c
===================================================================
--- trunk/src/netmsg.c	2005-11-11 19:12:56 UTC (rev 15)
+++ trunk/src/netmsg.c	2005-11-11 19:54:23 UTC (rev 16)
@@ -827,7 +827,7 @@
     if (rc != NPE_SUCCESS) {
       new_test->state  = TEST_ERROR;
       new_test->err_rc = rc;
-      new_test->err_fn = "__func__";
+      new_test->err_fn = (char *)__func__;
       rc = NPE_TEST_INIT_FAILED;
       break;
     }
@@ -879,7 +879,7 @@
     if (stats == NULL) {
       test->state  = TEST_ERROR;
       test->err_rc = NPE_SYS_STATS_DROPPED;
-      test->err_fn = "__func__";
+      test->err_fn = (char *)__func__;
     }
   }
   return(rc);
@@ -911,7 +911,7 @@
     if (stats == NULL) {
       test->state  = TEST_ERROR;
       test->err_rc = NPE_TEST_STATS_DROPPED;
-      test->err_fn = "__func__";
+      test->err_fn = (char *)__func__;
     }
   }
   return(rc);

Modified: trunk/src/netperf.c
===================================================================
--- trunk/src/netperf.c	2005-11-11 19:12:56 UTC (rev 15)
+++ trunk/src/netperf.c	2005-11-11 19:54:23 UTC (rev 16)
@@ -688,7 +688,7 @@
       } else {
         pthread_mutex_lock(server->lock);
         server->state  = NSRV_ERROR;
-        server->err_fn = "__func__";
+        server->err_fn = (char *)__func__;
         if (rc == 0) {
           server->err_rc = NPE_REMOTE_CLOSE;
         } else {
@@ -709,7 +709,7 @@
       server->state_req = NSRV_WORK;
     } else {
       server->state  = NSRV_ERROR;
-      server->err_fn = "__func__";
+      server->err_fn = (char *)__func__;
       server->err_rc = rc;
     }
   }
@@ -764,7 +764,7 @@
         if (rc != NPE_SUCCESS) {
           test->state  = TEST_ERROR;
           test->err_rc = rc;
-          test->err_fn = "__func__";
+          test->err_fn = (char *)__func__;
           rc = NPE_DEPENDENCY_NOT_PRESENT;
           break;
         } 
@@ -880,7 +880,7 @@
   if (rc != NPE_SUCCESS) {
     test->state  = TEST_ERROR;
     test->err_rc = rc;
-    test->err_fn = "__func__";
+    test->err_fn = (char *)__func__;
   }
 
 
@@ -919,7 +919,7 @@
           if (rc != NPE_SUCCESS) {
             test->state = TEST_ERROR;
             test->err_rc = rc;
-            test->err_fn = "__func__";
+            test->err_fn = (char *)__func__;
           };
         }
         /* should we restart the chain just incase an entry was inserted
@@ -983,7 +983,7 @@
     if (rc != NPE_SUCCESS) {
       server->state  = NSRV_ERROR;
       server->err_rc = rc;
-      server->err_fn = "__func__";
+      server->err_fn = (char *)__func__;
     }
   }
 
@@ -1031,7 +1031,7 @@
         if (rc != NPE_SUCCESS) {
           server->state = NSRV_ERROR;
           server->err_rc = rc;
-          server->err_fn = "__func__";
+          server->err_fn = (char *)__func__;
         }
       }
       server = server->next;
@@ -1193,7 +1193,7 @@
         if (rc != NPE_SUCCESS) {
           test->state  = TEST_ERROR;
           test->err_rc = rc;
-          test->err_fn = "__func__";
+          test->err_fn = (char *)__func__;
         }
       }
       set_elt = set_elt->next;
@@ -1216,7 +1216,7 @@
       if (rc != NPE_SUCCESS) {
         test->state  = TEST_ERROR;
         test->err_rc = rc;
-        test->err_fn = "__func__";
+        test->err_fn = (char *)__func__;
       }
     }
   }
@@ -1622,7 +1622,7 @@
         if (rc != NPE_SUCCESS) {
           test->state  = TEST_ERROR;
           test->err_rc = rc;
-          test->err_fn = "__func__";
+          test->err_fn = (char *)__func__;
         }
       }
       set_elt = set_elt->next;
@@ -1644,7 +1644,7 @@
       if (rc != NPE_SUCCESS) {
         test->state  = TEST_ERROR;
         test->err_rc = rc;
-        test->err_fn = "__func__";
+        test->err_fn = (char *)__func__;
       }
     }
   }

Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c	2005-11-11 19:12:56 UTC (rev 15)
+++ trunk/src/netserver.c	2005-11-11 19:54:23 UTC (rev 16)
@@ -104,7 +104,7 @@
 int        want_quiet;                                  /* --quiet, --silent */
 int        want_brief;                                  /* --brief */
 int        want_verbose;                                /* --verbose */
-int        forground = 2;
+int        forground = 1;
 char      *listen_port = NETPERF_DEFAULT_SERVICE_NAME;  /* --port */
 uint16_t   listen_port_num = 0;                         /* --port */
 char      *local_host_name       = NULL;
@@ -182,7 +182,7 @@
 	  debug++;
 	  break;
         case 'f':       /* --forground */
-          forground++;  /* 1 means no deamon, 2 means no fork */
+          forground++;  /* 1 means no deamon, 2 means no fork after accept */
           break;
 	case 'L':
 	  break_args_explicit(optarg,local_host_name_buf,local_addr_fam_buf);
@@ -537,7 +537,7 @@
         }
       } else {
         netperf->state = NSRV_ERROR;
-        netperf->err_fn = "__func__";
+        netperf->err_fn = (char *)__func__;
         if (rc == 0) {
           netperf->err_rc = NPE_REMOTE_CLOSE;
         } else {
@@ -558,7 +558,7 @@
     if (rc != NPE_SUCCESS) {
       netperf->state  = NSRV_ERROR;
       netperf->err_rc = rc;
-      netperf->err_fn = "__func__";
+      netperf->err_fn = (char *)__func__;
     }
   }
 
@@ -675,12 +675,10 @@
 	    exit;
 	  }
 	  handle_netperf_requests();
-	  /* if we get here, before we go back to call accept again,
-	     probably a good idea to close the sock. of course, I'm not
-	     even sure we will ever get here, but hey, what the heck.
-	     raj 2005-11-10 */
-	  printf("server closing sock %d\n",sock);
-	  close(sock);
+	  /* as the child, if we've no more requests to process - eg
+	     the connection has closed etc, then we might as well just
+	     exit. raj 2005-11-11 */
+	  exit(0);
 	  break;
 	default:
 	  /* we are the parent, close the socket we just accept()ed



More information about the netperf-dev mailing list