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
ed001e0c
Commit
ed001e0c
authored
Nov 20, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configure.ac: add option "--disable-daemon"
parent
26382713
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
Makefile.am
Makefile.am
+7
-2
configure.ac
configure.ac
+13
-0
Main.cxx
src/Main.cxx
+17
-6
No files found.
Makefile.am
View file @
ed001e0c
...
...
@@ -186,9 +186,14 @@ if ANDROID
else
libmpd_a_SOURCES
+=
\
src/unix/SignalHandlers.cxx src/unix/SignalHandlers.hxx
\
src/unix/Daemon.cxx src/unix/Daemon.hxx
\
src/unix/PidFile.hxx
\
src/CommandLine.cxx src/CommandLine.hxx
if
ENABLE_DAEMON
libmpd_a_SOURCES
+=
\
src/unix/Daemon.cxx src/unix/Daemon.hxx
\
src/unix/PidFile.hxx
endif
endif
if
ENABLE_DATABASE
...
...
configure.ac
View file @
ed001e0c
...
...
@@ -367,6 +367,19 @@ AC_ARG_ENABLE(nfs,
[enable support for libnfs (default: auto)]),,
[enable_nfs=auto])
default_enable_daemon=yes
if test x$host_is_android = xyes || test x$host_is_android = xyes; then
default_enable_daemon=no
fi
AC_ARG_ENABLE(daemon,
AS_HELP_STRING([--enable-daemon],
[enable daemonization (default: enabled)]),,
enable_daemon=$default_enable_daemon)
AM_CONDITIONAL([ENABLE_DAEMON], [test x$enable_daemon = xyes])
if test x$enable_daemon = xyes; then
AC_DEFINE([ENABLE_DAEMON], 1, [Enable daemonization?])
fi
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging (default: disabled)]),,
...
...
src/Main.cxx
View file @
ed001e0c
...
...
@@ -50,7 +50,6 @@
#include "AudioConfig.hxx"
#include "pcm/PcmConvert.hxx"
#include "unix/SignalHandlers.hxx"
#include "unix/Daemon.hxx"
#include "system/FatalError.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
...
...
@@ -65,6 +64,10 @@
#include "config/ConfigError.hxx"
#include "Stats.hxx"
#ifdef ENABLE_DAEMON
#include "unix/Daemon.hxx"
#endif
#ifdef ENABLE_DATABASE
#include "db/update/Service.hxx"
#include "db/Configured.hxx"
...
...
@@ -133,7 +136,7 @@ Instance *instance;
static
StateFile
*
state_file
;
#if
ndef ANDROID
#if
def ENABLE_DAEMON
static
bool
glue_daemonize_init
(
const
struct
options
*
options
,
Error
&
error
)
...
...
@@ -422,9 +425,11 @@ int mpd_main(int argc, char *argv[])
struct
options
options
;
Error
error
;
#if
ndef ANDROID
#if
def ENABLE_DAEMON
daemonize_close_stdin
();
#endif
#ifndef ANDROID
#ifdef HAVE_LOCALE_H
/* initialize locale */
setlocale
(
LC_CTYPE
,
""
);
...
...
@@ -470,7 +475,9 @@ int mpd_main(int argc, char *argv[])
LogError
(
error
);
return
EXIT_FAILURE
;
}
#endif
#ifdef ENABLE_DAEMON
if
(
!
glue_daemonize_init
(
&
options
,
error
))
{
LogError
(
error
);
return
EXIT_FAILURE
;
...
...
@@ -512,7 +519,7 @@ int mpd_main(int argc, char *argv[])
return
EXIT_FAILURE
;
}
#if
ndef ANDROID
#if
def ENABLE_DAEMON
daemonize_set_user
();
daemonize_begin
(
options
.
daemon
);
#endif
...
...
@@ -585,9 +592,11 @@ static int mpd_main_after_fork(struct options options)
playlist_list_global_init
();
#if
ndef ANDROID
#if
def ENABLE_DAEMON
daemonize_commit
();
#endif
#ifndef ANDROID
setup_log_output
(
options
.
log_stderr
);
SignalHandlersInit
(
*
instance
->
event_loop
);
...
...
@@ -724,9 +733,11 @@ static int mpd_main_after_fork(struct options options)
delete
instance
->
event_loop
;
delete
instance
;
instance
=
nullptr
;
#ifndef ANDROID
#ifdef ENABLE_DAEMON
daemonize_finish
();
#endif
#ifdef WIN32
WSACleanup
();
#endif
...
...
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