From 12b7fb9ad53ba48c672e1e292c8ae50a3e245a5f Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Tue, 31 Jan 2023 20:44:15 -0700 Subject: [PATCH] Revise from MOTION_SIGNAL to MOTPLS_SIGNAL --- src/motionplus.cpp | 22 +++++++++++----------- src/motionplus.hpp | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/motionplus.cpp b/src/motionplus.cpp index 5b0b930b..d8e27b96 100644 --- a/src/motionplus.cpp +++ b/src/motionplus.cpp @@ -31,7 +31,7 @@ #include "draw.hpp" pthread_key_t tls_key_threadnr; -volatile enum MOTION_SIGNAL motsignal; +volatile enum MOTPLS_SIGNAL motsignal; /** Process signals sent */ static void motion_signal_process(ctx_motapp *motapp) @@ -39,7 +39,7 @@ static void motion_signal_process(ctx_motapp *motapp) int indx; switch(motsignal){ - case MOTION_SIGNAL_ALARM: /* Trigger snapshot */ + case MOTPLS_SIGNAL_ALARM: /* Trigger snapshot */ if (motapp->cam_list != NULL) { for (indx=0; indxcam_cnt; indx++) { if (motapp->cam_list[indx]->conf->snapshot_interval) { @@ -48,17 +48,17 @@ static void motion_signal_process(ctx_motapp *motapp) } } break; - case MOTION_SIGNAL_USR1: /* Trigger the end of a event */ + case MOTPLS_SIGNAL_USR1: /* Trigger the end of a event */ if (motapp->cam_list != NULL) { for (indx=0; indxcam_cnt; indx++) { motapp->cam_list[indx]->event_stop = true; } } break; - case MOTION_SIGNAL_SIGHUP: /* Restart the threads */ + case MOTPLS_SIGNAL_SIGHUP: /* Restart the threads */ motapp->restart_all = true; /*FALLTHROUGH*/ - case MOTION_SIGNAL_SIGTERM: /* Quit application */ + case MOTPLS_SIGNAL_SIGTERM: /* Quit application */ motapp->webcontrol_finish = true; for (indx=0; indxcam_cnt; indx++) { @@ -75,7 +75,7 @@ static void motion_signal_process(ctx_motapp *motapp) default: break; } - motsignal = MOTION_SIGNAL_NONE; + motsignal = MOTPLS_SIGNAL_NONE; } /** Handle signals sent */ @@ -85,20 +85,20 @@ static void sig_handler(int signo) /*The FALLTHROUGH is a special comment required by compiler. Do not edit it*/ switch(signo) { case SIGALRM: - motsignal = MOTION_SIGNAL_ALARM; + motsignal = MOTPLS_SIGNAL_ALARM; break; case SIGUSR1: - motsignal = MOTION_SIGNAL_USR1; + motsignal = MOTPLS_SIGNAL_USR1; break; case SIGHUP: - motsignal = MOTION_SIGNAL_SIGHUP; + motsignal = MOTPLS_SIGNAL_SIGHUP; break; case SIGINT: /*FALLTHROUGH*/ case SIGQUIT: /*FALLTHROUGH*/ case SIGTERM: - motsignal = MOTION_SIGNAL_SIGTERM; + motsignal = MOTPLS_SIGNAL_SIGTERM; break; case SIGSEGV: exit(0); @@ -796,7 +796,7 @@ int main (int argc, char **argv) } } - if (motsignal != MOTION_SIGNAL_NONE) { + if (motsignal != MOTPLS_SIGNAL_NONE) { motion_signal_process(motapp); } diff --git a/src/motionplus.hpp b/src/motionplus.hpp index 1c9529dd..60c20704 100644 --- a/src/motionplus.hpp +++ b/src/motionplus.hpp @@ -187,12 +187,12 @@ enum FLIP_TYPE { FLIP_TYPE_VERTICAL }; -enum MOTION_SIGNAL { - MOTION_SIGNAL_NONE, - MOTION_SIGNAL_ALARM, - MOTION_SIGNAL_USR1, - MOTION_SIGNAL_SIGHUP, - MOTION_SIGNAL_SIGTERM +enum MOTPLS_SIGNAL { + MOTPLS_SIGNAL_NONE, + MOTPLS_SIGNAL_ALARM, + MOTPLS_SIGNAL_USR1, + MOTPLS_SIGNAL_SIGHUP, + MOTPLS_SIGNAL_SIGTERM }; enum CAPTURE_RESULT {