author | Michael Krelin <hacker@klever.net> | 2004-08-01 19:31:38 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2004-08-01 19:31:38 (UTC) |
commit | 5cb38f4c865b62e45b70e6bf2e16ca6c3909e599 (patch) (unidiff) | |
tree | 2556986b34054df0e54fb130b289638cca6175ab /src | |
parent | 01aa1814c01211e6423540aa40433e469c65952b (diff) | |
download | dudki-5cb38f4c865b62e45b70e6bf2e16ca6c3909e599.zip dudki-5cb38f4c865b62e45b70e6bf2e16ca6c3909e599.tar.gz dudki-5cb38f4c865b62e45b70e6bf2e16ca6c3909e599.tar.bz2 |
-r no longer acts as -e
-rw-r--r-- | src/dudki.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dudki.cc b/src/dudki.cc index c966695..3af5372 100644 --- a/src/dudki.cc +++ b/src/dudki.cc | |||
@@ -225,30 +225,29 @@ int main(int argc,char **argv) { | |||
225 | if(op_signum) | 225 | if(op_signum) |
226 | i->second.signal(op_signum); | 226 | i->second.signal(op_signum); |
227 | else | 227 | else |
228 | i->second.check(); | 228 | i->second.check(); |
229 | }catch(exception& e) { | 229 | }catch(exception& e) { |
230 | cerr << "dudki(" << argv[narg] << "): " << e.what() << endl; | 230 | cerr << "dudki(" << argv[narg] << "): " << e.what() << endl; |
231 | failures++; | 231 | failures++; |
232 | } | 232 | } |
233 | } | 233 | } |
234 | if(failures) | 234 | if(failures) |
235 | throw runtime_error("not all processes have been successfully signaled"); | 235 | throw runtime_error("not all processes have been successfully signaled"); |
236 | } | 236 | } |
237 | if(!op_signum) | 237 | exit(0); |
238 | exit(0); | ||
239 | }catch(exception& e) { | 238 | }catch(exception& e) { |
240 | if(!op_signum) | 239 | exit(1); |
241 | exit(1); | ||
242 | } | 240 | } |
241 | break; | ||
243 | case op_ensure: | 242 | case op_ensure: |
244 | try { | 243 | try { |
245 | signal_self(config,0); | 244 | signal_self(config,0); |
246 | break; | 245 | break; |
247 | }catch(exception& e) { | 246 | }catch(exception& e) { |
248 | syslog(LOG_NOTICE,"The dudki process is down, taking its place"); | 247 | syslog(LOG_NOTICE,"The dudki process is down, taking its place"); |
249 | config.daemonize = true; | 248 | config.daemonize = true; |
250 | }catch(int zero) { | 249 | }catch(int zero) { |
251 | // we throw zero in case we're ensuring that this very process is running. | 250 | // we throw zero in case we're ensuring that this very process is running. |
252 | // we don't have to daemonize if we're daemonic. | 251 | // we don't have to daemonize if we're daemonic. |
253 | config.daemonize = false; | 252 | config.daemonize = false; |
254 | } | 253 | } |
@@ -280,13 +279,14 @@ int main(int argc,char **argv) { | |||
280 | } | 279 | } |
281 | if(restarting) | 280 | if(restarting) |
282 | execvp(_argv[0],_argv); | 281 | execvp(_argv[0],_argv); |
283 | } | 282 | } |
284 | break; | 283 | break; |
285 | default: | 284 | default: |
286 | throw runtime_error(string(__PRETTY_FUNCTION__)+": internal error"); | 285 | throw runtime_error(string(__PRETTY_FUNCTION__)+": internal error"); |
287 | } | 286 | } |
288 | }catch(exception& e) { | 287 | }catch(exception& e) { |
289 | cerr << "Oops: " << e.what() << endl; | 288 | cerr << "Oops: " << e.what() << endl; |
290 | return 1; | 289 | return 1; |
291 | } | 290 | } |
291 | exit(0); | ||
292 | } | 292 | } |