summaryrefslogtreecommitdiffabout
path: root/gammu/emb/gammu/smsd/smsdcore.c
Side-by-side diff
Diffstat (limited to 'gammu/emb/gammu/smsd/smsdcore.c') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/gammu/smsd/smsdcore.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gammu/emb/gammu/smsd/smsdcore.c b/gammu/emb/gammu/smsd/smsdcore.c
index cc9accc..e69a6e7 100644
--- a/gammu/emb/gammu/smsd/smsdcore.c
+++ b/gammu/emb/gammu/smsd/smsdcore.c
@@ -110,11 +110,11 @@ void SMSD_ReadConfig(char *filename, GSM_SMSDConfig *Config, bool log, char *ser
Config->PINCode=INI_GetValue(smsdcfgfile, "smsd", "PIN", false);
if (Config->PINCode == NULL) {
- if (log) WriteSMSDLog("No PIN code in %s file",filename);
- fprintf(stderr,"No PIN code in %s file\n",filename);
- exit(-1);
- }
+ if (log) WriteSMSDLog("Warning: No PIN code in %s file",filename);
+ fprintf(stderr,"Warning: No PIN code in %s file\n",filename);
+ } else {
if (log) WriteSMSDLog("PIN code is \"%s\"",Config->PINCode);
+ }
str = INI_GetValue(smsdcfgfile, "smsd", "commtimeout", false);
if (str) Config->commtimeout=atoi(str); else Config->commtimeout = 1;
@@ -217,6 +217,10 @@ bool SMSD_CheckSecurity(GSM_SMSDConfig *Config)
/* If PIN, try to enter */
switch (SecurityCode.Type) {
case SEC_Pin:
+ if (Config->PINCode==NULL) {
+ WriteSMSDLog("Warning: no PIN in config");
+ return false;
+ } else {
WriteSMSDLog("Trying to enter PIN");
strcpy(SecurityCode.Code,Config->PINCode);
error=Phone->EnterSecurityCode(&s,SecurityCode);
@@ -227,6 +231,7 @@ bool SMSD_CheckSecurity(GSM_SMSDConfig *Config)
WriteSMSDLog("Error entering PIN (%i)", error);
return false;
}
+ }
break;
case SEC_SecurityCode:
case SEC_Pin2: