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 428 by douglas, 2005-03-24T17:38:00-08:00 vs.
Revision 429 by douglas, 2005-03-25T18:47:25-08:00

# Line 103 | Line 103 | Spectre2::Spectre2(const api::Path& conf
103                  fout << ::getpid() << ios::NewLine;
104          }
105  
106 <        Mounter mounter(config);
107 <        Unmounter unmounter(config);
106 >        Daemon daemon_(config);
107  
108 <        daemons.InsertLast(dynamic_cast<Daemon*>(&mounter));
110 <        daemons.InsertLast(dynamic_cast<Daemon*>(&unmounter));
108 >        daemon = &daemon_;
109  
110          {
111                  struct ::sigaction action;
# Line 123 | Line 121 | Spectre2::Spectre2(const api::Path& conf
121                  api::Posix::CheckError(::sigaction(SIGINT, &action, NULL));
122                  api::Posix::CheckError(::sigaction(SIGTERM, &action, NULL));
123          }
126
127        _foreach (ext::Vector<Daemon*>, daemon, daemons) (*daemon)->start();
128        _foreach (ext::Vector<Daemon*>, daemon, daemons) (*daemon)->wait();
124   }
125  
126   Spectre2::~Spectre2()
# Line 135 | Line 130 | Spectre2::~Spectre2()
130  
131   ext::String Spectre2::program(api::GetExecutablePath().GetName()), Spectre2::prefix(_Spectre2_prefix_), Spectre2::root(_Spectre2_root_), Spectre2::mount(_Spectre2_mount_);
132   bool Spectre2::debug(false);
133 < ext::Vector<Daemon*> Spectre2::daemons;
139 < ext::RedBlackSet<Share> Spectre2::shares;
140 < api::ThreadMutex Spectre2::sharesLock;
133 > Daemon* Spectre2::daemon;
134  
135   extern "C"
136   {
137          void reload(int signal, ::siginfo_t* info, void* uap)
138          {
139 <                _foreach (ext::Vector<Daemon*>, daemon, Spectre2::daemons) (*daemon)->reload();
139 >                Spectre2::daemon->reload();
140          }
141  
142          void stop(int signal, ::siginfo_t* info, void* uap)
143          {
144 <                _foreach (ext::Vector<Daemon*>, daemon, Spectre2::daemons) (*daemon)->stop();
144 >                Spectre2::daemon->stop();
145          }
146   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines