author | Michael Krelin <hacker@klever.net> | 2013-02-12 20:37:10 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2013-02-12 20:37:10 (UTC) |
commit | 13fb4abba3fd3cac0d5cb25d3eccddc298220d41 (patch) (side-by-side diff) | |
tree | 8a086ffef06f153e739674a5c8beab1db9388238 /src/iiid.cc | |
parent | b80844f51353339cfbb8b35a5585911cdb4301e2 (diff) | |
download | iii-13fb4abba3fd3cac0d5cb25d3eccddc298220d41.zip iii-13fb4abba3fd3cac0d5cb25d3eccddc298220d41.tar.gz iii-13fb4abba3fd3cac0d5cb25d3eccddc298220d41.tar.bz2 |
introduce throwable_exit for nicer stack unwinding
yes, I enjoy abusing features
Signed-off-by: Michael Krelin <hacker@klever.net>
-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 @@ -76,22 +76,24 @@ int main(int argc,char **argv) try { 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; } |