Commit da2515c4 authored by Axel Auweter's avatar Axel Auweter
Browse files

Replace the non-standard daemon()-call with our own implementation.

parent 604f2f56
......@@ -18,6 +18,7 @@
#include "simplemqttserver.h"
#include "messaging.h"
#include "abrt.h"
#include "dcdbdaemon.h"
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
......@@ -164,7 +165,7 @@ int main(int argc, char* const argv[]) {
ttl = optarg;
break;
case 'D':
daemon(1,1);
dcdbdaemon();
break;
case '?':
default:
......
/*
* endian.h
*
* Created on: May 17, 2015
* Author: Axel Auweter
*/
#ifndef DCDBDAEMON_H
#define DCDBDAEMON_H
#include <unistd.h>
#include <cstdlib>
static int dcdbdaemon()
{
switch(fork()) {
case -1:
return -1;
break;
case 0:
break;
default:
exit(0);
}
if (setsid() == -1)
return -1;
return 0;
}
#endif /* DCDBDAEMON_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment