Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
da2515c4
Commit
da2515c4
authored
May 17, 2015
by
Axel Auweter
Browse files
Replace the non-standard daemon()-call with our own implementation.
parent
604f2f56
Changes
2
Hide whitespace changes
Inline
Side-by-side
CollectAgent/collectagent.cpp
View file @
da2515c4
...
...
@@ -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
);
dcdb
daemon
();
break
;
case
'?'
:
default:
...
...
include/dcdbdaemon.h
0 → 100644
View file @
da2515c4
/*
* 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 */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment