Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9c932494
Commit
9c932494
authored
Jan 18, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daemon: pass "detach" flag to daemonize()
This way, we don't have to pass the full "Options" object to daemonize().
parent
bfcaecab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
daemon.c
src/daemon.c
+4
-3
daemon.h
src/daemon.h
+2
-2
main.c
src/main.c
+1
-1
No files found.
src/daemon.c
View file @
9c932494
...
...
@@ -18,7 +18,8 @@
#include "daemon.h"
#include <stdbool.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
...
...
@@ -133,7 +134,7 @@ daemonize_set_user(void)
}
void
daemonize
(
Options
*
options
)
daemonize
(
bool
detach
)
{
#ifndef WIN32
FILE
*
fp
=
NULL
;
...
...
@@ -149,7 +150,7 @@ daemonize(Options *options)
}
}
if
(
options
->
daemon
)
{
if
(
detach
)
{
int
pid
;
fflush
(
NULL
);
...
...
src/daemon.h
View file @
9c932494
...
...
@@ -19,7 +19,7 @@
#ifndef DAEMON_H
#define DAEMON_H
#include
"cmdline.h"
#include
<stdbool.h>
void
daemonize_init
(
const
char
*
user
,
const
char
*
pidfile
);
...
...
@@ -47,6 +47,6 @@ void
daemonize_set_user
(
void
);
void
daemonize
(
Options
*
options
);
daemonize
(
bool
detach
);
#endif
src/main.c
View file @
9c932494
...
...
@@ -245,7 +245,7 @@ int main(int argc, char *argv[])
initNormalization
();
input_stream_global_init
();
daemonize
(
&
options
);
daemonize
(
options
.
daemon
);
setup_log_output
(
options
.
stdOutput
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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