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

Comparing Spectre2/Daemon.cpp (file contents):
Revision 431 by douglas, 2005-03-26T22:35:26-08:00 vs.
Revision 432 by douglas, 2005-03-27T01:56:29-08:00

# Line 26 | Line 26 | Daemon::~Daemon()
26  
27   #ifdef __FreeBSD__
28          api::Posix::CheckError(::unlink(secret.NullTerminate()));
29 + #else
30 +        _foreach (const ext::RedBlackMap<ext::String>, secret, secrets)
31 +                api::Posix::CheckError(::unlink(secret.NullTerminate()));
32   #endif
33   }
34  
# Line 33 | Line 36 | ext::RedBlackSet<Share> Daemon::shares;
36   //api::ThreadMutex Daemon::smbcLock;
37   #ifdef __FreeBSD__
38   ext::String Daemon::secret(api::TheEnvironment.Get("HOME") + "/.nsmbrc");
39 + api::ThreadMutex Daemon::secretLock;
40 + #else
41 + ext::RedBlackMap<ext::String> Daemon::secrets;
42 + api::ThreadMutex Daemon::secretsLock;
43   #endif
44  
45   int Daemon::loop()
# Line 67 | Line 74 | void Daemon::load()
74          if (!(*spectre/"mount").IsEmpty())
75                  Spectre2::mount = *spectre/"mount";
76  
77 +        if (!(*spectre/"umount").IsEmpty())
78 +                Spectre2::umount = *spectre/"umount";
79 +
80          if (!(*spectre/"interval").IsEmpty())
81                  interval = lexical_cast<unsigned>(ext::String(*spectre/"interval"));
82  
# Line 134 | Line 144 | int Daemon::work()
144                  }
145                  catch (const Error&) { --count; }*/
146  
147 <                if (running && loaded) try
138 <                {
147 >                if (running && loaded)
148                          sleep();
140                }
141                catch (const api::Error&)
142                {
143                        api::Cout << "Can't sleep!" << ios::NewLine;
144                }
149  
150                  workers.Join();
151          }
# Line 164 | Line 168 | void Daemon::sleep()
168   {
169          ::timespec wait = { interval, 0 };
170  
171 <        api::Posix::CheckError(::nanosleep(&wait, NULL));
171 >        ::nanosleep(&wait, NULL);
172   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines