Fixed dummy error: SIGUSR2 should capture and exit even if verbose is false
authorAdrian Antunez <adrian@ymaging.com>
Thu, 26 Jan 2017 09:33:42 +0000 (10:33 +0100)
committerpopcornmix <popcornmix@gmail.com>
Thu, 26 Jan 2017 17:27:44 +0000 (17:27 +0000)
host_applications/linux/apps/raspicam/RaspiStill.c

index f6e5f0ca2a3dbcde358e2a321b140434252be116..aac78b6beafc2c8b048b1b5145ea35af9895364c 100644 (file)
@@ -58,7 +58,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <errno.h>
 #include <sysexits.h>
 
-#define VERSION_STRING "v1.3.9"
+#define VERSION_STRING "v1.3.10"
 
 #include "bcm_host.h"
 #include "interface/vcos/vcos.h"
@@ -1701,25 +1701,25 @@ static int wait_for_next_frame(RASPISTILL_STATE *state, int *frame)
 
       result = sigwait( &waitset, &sig );
 
-      if (state->verbose)
+      if (result == 0)
       {
-         if( result == 0)
+         if (sig == SIGUSR1)
          {
-            if (sig == SIGUSR1)
-            {
+            if (state->verbose)
                fprintf(stderr, "Received SIGUSR1\n");
-            }
-            else if (sig == SIGUSR2)
-            {
-               fprintf(stderr, "Received SIGUSR2\n");
-               keep_running = 0;
-            }
          }
-         else
+         else if (sig == SIGUSR2)
          {
-            fprintf(stderr, "Bad signal received - error %d\n", errno);
+            if (state->verbose)
+               fprintf(stderr, "Received SIGUSR2\n");
+            keep_running = 0;
          }
       }
+      else
+      {
+         if (state->verbose)
+            fprintf(stderr, "Bad signal received - error %d\n", errno);
+      }
 
       *frame+=1;