From 73bdb15644a5f7d2dd221633cb693930469b577d Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Tue, 20 Dec 2011 17:05:53 +0400 Subject: [PATCH] rename variable "sms_send_enable" to "sms_enable" --- yasnd-ipc.c | 4 ++-- yasnd.c | 10 +++++----- yasnd.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/yasnd-ipc.c b/yasnd-ipc.c index 9efe007..9a971c0 100644 --- a/yasnd-ipc.c +++ b/yasnd-ipc.c @@ -71,7 +71,7 @@ int ipc_queue_loop() char dbg_txt[150]; sprintf(dbg_txt,"Read IPC message - Type: %ld Text: %s", qbuf.mtype, qbuf.mtext); log_debug(dbg_txt,DEBUG_ALL); - if (qbuf.mtype==SMS_RECEIVE_TYPE && sms_send_enable) + if (qbuf.mtype==SMS_RECEIVE_TYPE && sms_enable) { pid_t pid = fork(); if (pid < 0) { @@ -87,7 +87,7 @@ int ipc_queue_loop() // STUB: need to react on status, returned by thread waitpid(pid,NULL,0); } - if (qbuf.mtype==SMS_SEND_TYPE && sms_send_enable) + if (qbuf.mtype==SMS_SEND_TYPE && sms_enable) { log_debug(qbuf.mtext,DEBUG_BASE); pid_t pid = fork(); diff --git a/yasnd.c b/yasnd.c index fd92f78..c33db8a 100644 --- a/yasnd.c +++ b/yasnd.c @@ -11,7 +11,7 @@ cfg_t *cfg; // pointer to configuration structure host_decl* hosts=NULL; // structure with hosts' definitions int hosts_count=0; // count of hosts int debug_flag=0; -bool sms_send_enable=false; // send or not send alerts via SMS +bool sms_enable=false; // use SMS messages for control and reports? char* phone_device=NULL; // phone device for gammu, for example: "/dev/ttyACM0" char* phone_model=NULL; // gammu phone model, for example: "at" char* phone_connection=NULL; // gammu phone connection type, for example: "at" @@ -101,7 +101,7 @@ void init() CFG_SIMPLE_INT("debug", &debug_flag), CFG_SIMPLE_BOOL("lpt_enable", &lpt_enable), CFG_SIMPLE_INT("lpt_port", &lpt_port), - CFG_SIMPLE_BOOL("sms_send_enable", &sms_send_enable), + CFG_SIMPLE_BOOL("sms_enable", &sms_enable), CFG_SIMPLE_STR("phone_device", &phone_device), CFG_SIMPLE_STR("phone_model", &phone_connection), CFG_SIMPLE_STR("phone_connection", &phone_model), @@ -117,8 +117,8 @@ void init() log_event("Error parsing config file"); exit(EXIT_FAILURE); } - // if SMS sending is enabled, all of phone parameters must be explicitly defined - if (sms_send_enable) + // if SMS is enabled, all of phone parameters must be explicitly defined + if (sms_enable) { if (phone_model==NULL) { @@ -161,7 +161,7 @@ void init() hosts[i].reaction_obtained=false; } // initialize gammu structures - if (sms_send_enable) + if (sms_enable) gammu_init(); // initialize LPT control circuit if (lpt_enable) diff --git a/yasnd.h b/yasnd.h index e22b93f..45a2e09 100644 --- a/yasnd.h +++ b/yasnd.h @@ -55,7 +55,7 @@ extern char* recipient_number; extern char* phone_device; // phone device for gammu, for example: "/dev/ttyACM0" extern char* phone_model; // gammu phone model, for example: "at" extern char* phone_connection; // gammu phone connection type, for example: "at" -extern bool sms_send_enable; +extern bool sms_enable; extern int qid; #endif