Remove not used conditional.
authorRafał Długołęcki <rafal@dlugolecki.net.pl>
Sat, 21 Jun 2014 18:31:15 +0000 (20:31 +0200)
committerRafał Długołęcki <rafal@dlugolecki.net.pl>
Sat, 21 Jun 2014 18:31:15 +0000 (20:31 +0200)
src/process1.c
src/process2.c
src/process3.c

index fbbfa40c1b2d5f848ea279ce4ce954b106719062..601c356643e08bc3d297ff0ec621dc75e700fe3f 100644 (file)
@@ -82,7 +82,6 @@ void notify_other_processes(int signo) {
 void sig_handler(int signo)
 {
        fprintf(stderr, "[%s] Received %s!\n", "process1", strsignal(signo));
-
        if (signo == SIGUSR1) {
                fprintf(stderr, "[%s] > Notified!\n", "process1");
                struct queue_message msg;
@@ -91,10 +90,6 @@ void sig_handler(int signo)
                        fprintf(stderr, "[%s] > Notified with value: %s!\n", "process1", strsignal(msg.signo[0]));
                        raise(msg.signo[0]);
                }
-               else if (msgrcv(qid, &msg, sizeof(int), 1, 0) > 0) {
-                       fprintf(stderr, "[%s] > Notified with value: %s!\n", "process1", strsignal(msg.signo[0]));
-                       raise(msg.signo[0]);
-               }
        }
        else if (signo == SIGTERM) {
                fprintf(stderr, "[%s] > Signalling other processes..\n", "process1");
index 861919ce8b45b606fc11579ace0f6de0de3030e3..d498f1c8300de57ab9eefc5caf00629f09e4af0e 100644 (file)
@@ -94,10 +94,6 @@ void sig_handler(int signo)
                        fprintf(stderr, "[%s] > Notified with value: %s!\n", "process2", strsignal(msg.signo[0]));
                        raise(msg.signo[0]);
                }
-               else if (msgrcv(qid, &msg, sizeof(int), 2, 0) > 0) {
-                       fprintf(stderr, "[%s] > Notified with value: %s!\n", "process2", strsignal(msg.signo[0]));
-                       raise(msg.signo[0]);
-               }
        }
        else if (signo == SIGTERM) {
                fprintf(stderr, "[%s] > Signalling other processes..\n", "process2");
index 28ecce5dcb6b4076c56447d2d9d1f8a3260e0f40..6453a8fe2bbac70f8cf1b41e1d947aacdf198d00 100644 (file)
@@ -86,10 +86,6 @@ void sig_handler(int signo)
                        fprintf(stderr, "[%s] > Notified with value: %s!\n", "process3", strsignal(msg.signo[0]));
                        raise(msg.signo[0]);
                }
-               else if (msgrcv(qid, &msg, sizeof(int), 3, 0) > 0) {
-                       fprintf(stderr, "[%s] > Notified with value: %s!\n", "process3", strsignal(msg.signo[0]));
-                       raise(msg.signo[0]);
-               }
        }
        else if (signo == SIGTERM) {
                fprintf(stderr, "[%s] > Signalling other processes..\n", "process3");