comparison sources/engine.cpp @ 7:8d54d9fdeca3

fixed comments removed daemonization verbose strings' size() -> length()
author Vlad Glagolev <enqlave@gmail.com>
date Sun, 03 Feb 2008 21:29:41 +0300
parents 0faceb076254
children
comparison
equal deleted inserted replaced
6:9be05a31b7f9 7:8d54d9fdeca3
1 /** 1 /** engine.cpp (2007-03-05)
2 * engine.cpp (2007-03-05)
3 * 2 *
4 * -- CABAL -- engine (useful functions) 3 * -- CABAL -- engine (useful functions)
5 * 4 *
6 * Copyright (c) 2007-2008 Vlad Glagolev <enqlave@gmail.com> 5 * Copyright (c) 2007-2008 Vlad Glagolev <enqlave@gmail.com>
7 * All rights reserved. 6 * All rights reserved.
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 */ 19 */
21 20
22 #include "engine.hpp" 21 #include "cabal.hpp" // needed: engine.hpp
23 22
24 bool daemonize() 23 bool daemonize()
25 { 24 {
26 if (daemon(1, 1) != 0) { 25 if (daemon(1, 1) != 0) {
27 cout << "Error: unable to daemonize into background\n"; 26 cout << "Error: unable to daemonize into background\n";
28 exit(1); 27 exit(1);
29 } else { 28 } else {
30 cout << "ENGINE: successfully daemonized into background\n"; 29 if (CABAL->debug)
30 cout << "ENGINE: successfully daemonized into background\n";
31 return daemon(1, 1) == 0; 31 return daemon(1, 1) == 0;
32 } 32 }
33 } 33 }
34 34
35 time_t gettime() 35 time_t gettime()