summaryrefslogtreecommitdiffabout
path: root/src/iiid.cc
Unidiff
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 {
60 std::cerr << "Failed to parse port number" << std::endl; 60 std::cerr << "Failed to parse port number" << std::endl;
61 exit(1); 61 exit(1);
62 } 62 }
63 break; 63 break;
64 default: 64 default:
65 std::cerr << "Huh?" << std::endl; 65 std::cerr << "Huh?" << std::endl;
66 exit(1); 66 exit(1);
67 break; 67 break;
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