2009-07-18 20:39:31 +00:00
|
|
|
#include <QtCore/QCoreApplication>
|
|
|
|
|
#include "cleanerserver.h"
|
|
|
|
|
|
2010-09-25 20:03:36 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
#include <process.h>
|
|
|
|
|
#else
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#ifndef daemon
|
|
|
|
|
int daemon(int, int);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-07-18 20:39:31 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
QCoreApplication a(argc, argv);
|
|
|
|
|
CleanerServer server;
|
2010-09-25 20:03:36 +00:00
|
|
|
#ifndef _WIN32
|
2011-02-10 22:17:07 +00:00
|
|
|
if (daemon(0, 0) != 0)
|
|
|
|
|
return -1;
|
2010-09-25 20:03:36 +00:00
|
|
|
#endif
|
2009-07-18 20:39:31 +00:00
|
|
|
return a.exec();
|
|
|
|
|
}
|