Revision: 424
          http://vde.svn.sourceforge.net/vde/?rev=424&view=rev
Author:   shammash
Date:     2010-07-03 15:32:16 +0000 (Sat, 03 Jul 2010)

Log Message:
-----------
Hardcoded success return value

Do not rely on strerror() if rv == 0 because some systems
just print "Unknown error: 0" instead of "Success" .. unnice!

Signed-off-by: Luca Bigliardi <shamm...@artha.org>

Modified Paths:
--------------
    trunk/vde-2/src/vde_autolink.c
    trunk/vde-2/src/vde_switch/consmgmt.c
    trunk/vde-2/src/wirefilter.c

Modified: trunk/vde-2/src/vde_autolink.c
===================================================================
--- trunk/vde-2/src/vde_autolink.c      2010-06-28 00:06:06 UTC (rev 423)
+++ trunk/vde-2/src/vde_autolink.c      2010-07-03 15:32:16 UTC (rev 424)
@@ -1117,7 +1117,11 @@
                        rv=cl[i].fun(fd,inbuf);
                        printoutc(fd,".");
                }
-               printoutc(fd,"1%03d %s",rv,strerror(rv));
+               if (rv == 0) {
+                       printoutc(fd,"1000 Success");
+               } else {
+                       printoutc(fd,"1%03d %s",rv,strerror(rv));
+               }
                return rv;
        }
        return rv;

Modified: trunk/vde-2/src/vde_switch/consmgmt.c
===================================================================
--- trunk/vde-2/src/vde_switch/consmgmt.c       2010-06-28 00:06:06 UTC (rev 
423)
+++ trunk/vde-2/src/vde_switch/consmgmt.c       2010-07-03 15:32:16 UTC (rev 
424)
@@ -307,8 +307,11 @@
                                }
                        }
                }
-               if (rv >=0)
+               if (rv == 0) {
+                       printoutc(f,"1000 Success");
+               } else if (rv > 0) {
                        printoutc(f,"1%03d %s",rv,strerror(rv));
+               }
                fclose(f);
                if (fd >= 0)
                        write(fd,outbuf,outbufsize);

Modified: trunk/vde-2/src/wirefilter.c
===================================================================
--- trunk/vde-2/src/wirefilter.c        2010-06-28 00:06:06 UTC (rev 423)
+++ trunk/vde-2/src/wirefilter.c        2010-07-03 15:32:16 UTC (rev 424)
@@ -1298,10 +1298,15 @@
                        if (fd>=0 && commandlist[i].type & WITHFILE)
                                printoutc(fd,".");
                }
-               if (fd >= 0)
-                       printoutc(fd,"1%03d %s",rv,strerror(rv));
-               else if (rv != 0)
+               if (fd >= 0) {
+                       if (rv == 0) {
+                               printoutc(fd,"1000 Success");
+                       } else {
+                               printoutc(fd,"1%03d %s",rv,strerror(rv));
+                       }
+               } else if (rv != 0) {
                        printlog(LOG_ERR,"rc command error: %s 
%s",cmd,strerror(rv));
+               }
                return rv;
        }
        return rv;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
vde-users mailing list
vde-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vde-users

Reply via email to