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 |
|
|
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() |
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 |
|
|
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 |
|
} |
168 |
|
{ |
169 |
|
::timespec wait = { interval, 0 }; |
170 |
|
|
171 |
< |
api::Posix::CheckError(::nanosleep(&wait, NULL)); |
171 |
> |
::nanosleep(&wait, NULL); |
172 |
|
} |