ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Spectre2/Spectre2.cpp
(Generate patch)

Comparing Spectre2/Spectre2.cpp (file contents):
Revision 409 by douglas, 2004-12-31T01:13:08-08:00 vs.
Revision 415 by douglas, 2005-01-15T18:26:13-08:00

# Line 19 | Line 19 | struct Spectre2Command : public app::App
19          virtual int Run(const app::ArgumentList& args)
20          {
21                  ext::String config("spectre.xml"), pid("spectre.pid");
22                bool fork(false);
22  
23                  _foreach (app::ArgumentList, arg, args)
24                  {
25                          Matcher matcher;
26  
27                          if (*arg == matcher("^-config=(.*)$")) config = matcher[1];
29                        else if (*arg == "-fork") fork = true;
28                          else if (*arg == matcher("^-pid=(.*)$")) pid = matcher[1];
29                          else if (*arg == "-D") Spectre2::debug = true;
30                          else
31                          {
32 <                                api::Cerr << "Usage: " << Spectre2::program << " [-config=config] [-fork] [-pid=pid] [-D]" << ios::NewLine;
32 >                                api::Cerr << "Usage: " << Spectre2::program << " [-config=config] [-pid=pid] [-D]" << ios::NewLine;
33  
34                                  return 1;
35                          }
36                  }
37  
40                if (fork && api::Posix::CheckError(::fork())) return 0;
41
38                  Spectre2(config, pid);
39  
40                  return 0;
# Line 73 | Line 69 | Spectre2::Spectre2(const ext::String& co
69                  action.sa_flags = SA_SIGINFO;
70  
71                  api::Posix::CheckError(::sigemptyset(&action.sa_mask));
72 <                api::Posix::CheckError(::sigaction(SIGHUP, &action, NULL));
72 >                api::Posix::CheckError(::sigaction(SIGUSR1, &action, NULL));
73  
74                  action.sa_sigaction = stop;
75  
# Line 89 | Line 85 | Spectre2::~Spectre2()
85          api::Posix::CheckError(::unlink(pid.NullTerminate()));
86   }
87  
88 < ext::String Spectre2::program(api::GetExecutablePath().GetName());
88 > ext::String Spectre2::program(api::GetExecutablePath().GetName()), Spectre2::prefix(_Spectre2_prefix_), Spectre2::root(_Spectre2_root_);
89   bool Spectre2::debug(false);
90   ext::Vector<Daemon*> Spectre2::daemons;
91  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines