-rw-r--r-- | src/iiid.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/iiid.cc b/src/iiid.cc index d655fe3..b3dd3bf 100644 --- a/src/iiid.cc +++ b/src/iiid.cc | |||
@@ -68,30 +68,32 @@ int main(int argc,char **argv) try { | |||
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
71 | const char *ident = rindex(*argv,'/'); | 71 | const char *ident = rindex(*argv,'/'); |
72 | if(ident) | 72 | if(ident) |
73 | ++ident; | 73 | ++ident; |
74 | else | 74 | else |
75 | ident = *argv; | 75 | ident = *argv; |
76 | openlog(ident,LOG_PERROR|LOG_PID,LOG_DAEMON); | 76 | openlog(ident,LOG_PERROR|LOG_PID,LOG_DAEMON); |
77 | syslog(LOG_INFO,"Starting iii eye-fi manager"); | 77 | syslog(LOG_INFO,"Starting iii eye-fi manager"); |
78 | 78 | ||
79 | struct stat st; | 79 | struct stat st; |
80 | if(stat(EYEKIN_CONF_DIR,&st) || !S_ISDIR(st.st_mode)) | 80 | if(stat(EYEKIN_CONF_DIR,&st) || !S_ISDIR(st.st_mode)) |
81 | syslog(LOG_WARNING,"configuration directory '%s' does not exist or is not a directory",EYEKIN_CONF_DIR); | 81 | syslog(LOG_WARNING,"configuration directory '%s' does not exist or is not a directory",EYEKIN_CONF_DIR); |
82 | glob_t g; int rg = glob(EYEKIN_CONF_DIR"/????????????.conf",GLOB_NOSORT,NULL,&g); | 82 | glob_t g; int rg = glob(EYEKIN_CONF_DIR"/????????????.conf",GLOB_NOSORT,NULL,&g); |
83 | if(rg || !g.gl_pathc) | 83 | if(rg || !g.gl_pathc) |
84 | syslog(LOG_WARNING,"I see nothing resembling a card config in '%s'",EYEKIN_CONF_DIR); | 84 | syslog(LOG_WARNING,"I see nothing resembling a card config in '%s'",EYEKIN_CONF_DIR); |
85 | else | 85 | else |
86 | globfree(&g); | 86 | globfree(&g); |
87 | 87 | ||
88 | eyefiworker().run(port); | 88 | eyefiworker().run(port); |
89 | 89 | ||
90 | closelog(); | 90 | closelog(); |
91 | return 0; | 91 | return 0; |
92 | } catch(std::exception& e) { | 92 | } catch(const throwable_exit& e) { |
93 | return e.rc; | ||
94 | } catch(const std::exception& e) { | ||
93 | syslog(LOG_CRIT,"Exiting iii daemon, because of error condition"); | 95 | syslog(LOG_CRIT,"Exiting iii daemon, because of error condition"); |
94 | syslog(LOG_CRIT,"Exception: %s",e.what()); | 96 | syslog(LOG_CRIT,"Exception: %s",e.what()); |
95 | return 1; | 97 | return 1; |
96 | } | 98 | } |
97 | 99 | ||