Revision: 473
          http://vde.svn.sourceforge.net/vde/?rev=473&view=rev
Author:   rd235
Date:     2011-02-14 15:37:56 +0000 (Mon, 14 Feb 2011)

Log Message:
-----------
Clean exit (exit status==0) when vde commands receive SIGTERM

Modified Paths:
--------------
    trunk/vde-2/src/kvde_switch/kvde_switch.c
    trunk/vde-2/src/vde_autolink.c
    trunk/vde-2/src/vde_pcapplug.c
    trunk/vde-2/src/vde_plug.c
    trunk/vde-2/src/vde_plug2tap.c
    trunk/vde-2/src/vde_switch/vde_switch.c
    trunk/vde-2/src/vdeq.c
    trunk/vde-2/src/vdeterm.c
    trunk/vde-2/src/wirefilter.c

Modified: trunk/vde-2/src/kvde_switch/kvde_switch.c
===================================================================
--- trunk/vde-2/src/kvde_switch/kvde_switch.c   2011-02-14 15:11:01 UTC (rev 
472)
+++ trunk/vde-2/src/kvde_switch/kvde_switch.c   2011-02-14 15:37:56 UTC (rev 
473)
@@ -410,7 +410,10 @@
        printlog(LOG_ERR,"Caught signal %d, cleaning up and exiting", sig);
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 }
 
 static void setsighandlers()

Modified: trunk/vde-2/src/vde_autolink.c
===================================================================
--- trunk/vde-2/src/vde_autolink.c      2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/vde_autolink.c      2011-02-14 15:37:56 UTC (rev 473)
@@ -186,7 +186,10 @@
        /*fprintf(stderr,"Caught signal %d, cleaning up and exiting", sig);*/
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 } 
 
 struct autolink *find_alink_pid(int pid);

Modified: trunk/vde-2/src/vde_pcapplug.c
===================================================================
--- trunk/vde-2/src/vde_pcapplug.c      2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/vde_pcapplug.c      2011-02-14 15:37:56 UTC (rev 473)
@@ -96,7 +96,10 @@
 {
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 }
 
 static void setsighandlers()

Modified: trunk/vde-2/src/vde_plug.c
===================================================================
--- trunk/vde-2/src/vde_plug.c  2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/vde_plug.c  2011-02-14 15:37:56 UTC (rev 473)
@@ -219,7 +219,10 @@
 {
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 }
 
 static void setsighandlers()

Modified: trunk/vde-2/src/vde_plug2tap.c
===================================================================
--- trunk/vde-2/src/vde_plug2tap.c      2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/vde_plug2tap.c      2011-02-14 15:37:56 UTC (rev 473)
@@ -91,7 +91,10 @@
 {
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 }
 
 static void setsighandlers()

Modified: trunk/vde-2/src/vde_switch/vde_switch.c
===================================================================
--- trunk/vde-2/src/vde_switch/vde_switch.c     2011-02-14 15:11:01 UTC (rev 
472)
+++ trunk/vde-2/src/vde_switch/vde_switch.c     2011-02-14 15:37:56 UTC (rev 
473)
@@ -473,7 +473,10 @@
        printlog(LOG_ERR,"Caught signal %d, cleaning up and exiting", sig);
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 }
 
 static void setsighandlers()

Modified: trunk/vde-2/src/vdeq.c
===================================================================
--- trunk/vde-2/src/vdeq.c      2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/vdeq.c      2011-02-14 15:37:56 UTC (rev 473)
@@ -132,7 +132,10 @@
        fprintf(stderr,"%s: Caught signal %d, cleaning up and exiting\n", 
vdeqname, sig);
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 }
 
 static void setsighandlers()

Modified: trunk/vde-2/src/vdeterm.c
===================================================================
--- trunk/vde-2/src/vdeterm.c   2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/vdeterm.c   2011-02-14 15:37:56 UTC (rev 473)
@@ -31,7 +31,10 @@
 { 
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 } 
 
 static void setsighandlers()

Modified: trunk/vde-2/src/wirefilter.c
===================================================================
--- trunk/vde-2/src/wirefilter.c        2011-02-14 15:11:01 UTC (rev 472)
+++ trunk/vde-2/src/wirefilter.c        2011-02-14 15:37:56 UTC (rev 473)
@@ -858,7 +858,10 @@
        /*fprintf(stderr,"Caught signal %d, cleaning up and exiting", sig);*/
        cleanup();
        signal(sig, SIG_DFL);
-       kill(getpid(), sig);
+       if (sig == SIGTERM)
+               _exit(0);
+       else
+               kill(getpid(), sig);
 } 
 
 static void setsighandlers()


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

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
vde-users mailing list
vde-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vde-users

Reply via email to