summaryrefslogtreecommitdiffabout
path: root/src/iiid.cc
Side-by-side diff
Diffstat (limited to 'src/iiid.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--src/iiid.cc4
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
@@ -60,38 +60,40 @@ int main(int argc,char **argv) try {
std::cerr << "Failed to parse port number" << std::endl;
exit(1);
}
break;
default:
std::cerr << "Huh?" << std::endl;
exit(1);
break;
}
}
const char *ident = rindex(*argv,'/');
if(ident)
++ident;
else
ident = *argv;
openlog(ident,LOG_PERROR|LOG_PID,LOG_DAEMON);
syslog(LOG_INFO,"Starting iii eye-fi manager");
struct stat st;
if(stat(EYEKIN_CONF_DIR,&st) || !S_ISDIR(st.st_mode))
syslog(LOG_WARNING,"configuration directory '%s' does not exist or is not a directory",EYEKIN_CONF_DIR);
glob_t g; int rg = glob(EYEKIN_CONF_DIR"/????????????.conf",GLOB_NOSORT,NULL,&g);
if(rg || !g.gl_pathc)
syslog(LOG_WARNING,"I see nothing resembling a card config in '%s'",EYEKIN_CONF_DIR);
else
globfree(&g);
eyefiworker().run(port);
closelog();
return 0;
-} catch(std::exception& e) {
+} catch(const throwable_exit& e) {
+ return e.rc;
+} catch(const std::exception& e) {
syslog(LOG_CRIT,"Exiting iii daemon, because of error condition");
syslog(LOG_CRIT,"Exception: %s",e.what());
return 1;
}