• Eric Wong's avatar
    Fix endless loop when mpd is launched from a non-interactive shell. · bbe8b0ef
    Eric Wong authored
    Thanks to _noth_ for the patch, this fixes Mantis bug #1534
    
    _noth_ wrote:
    > When MPD is launched from a non-interactive shell, it enters an endless
    > loop, filling up its error log file with "error accept()'ing" messages.
    > This is caused by the fact that stdin is already closed when mpd starts
    > up.  listenOnPort() opens up the first of its sockets as fd 0 (the first
    > empty fd table position). Then, setup_log_output()->redirect_stdin()
    > overwrites fd0 (fd=open("/dev/null",...); dup2(fd, STDIN_FILENO);)
    > without checking if it corresponds to the actual standard input (or if
    > it is open in the first place).  This means that listenSockets[0].fd now
    > is a fd for /dev/null, thus doIOForInterfaces()->getConnections() can't
    > accept(2) on it and fails with the above error. The attached patch fixes
    > this for me.
    
    git-svn-id: https://svn.musicpd.org/mpd/trunk@6843 09075e82-0dd4-0310-85a5-a0d7c8717e4f
    bbe8b0ef
Name
Last commit
Last update
..
audioOutputs Loading commit data...
inputPlugins Loading commit data...
mp4ff Loading commit data...
Makefile.am Loading commit data...
ack.h Loading commit data...
audio.c Loading commit data...
audio.h Loading commit data...
audioOutput.c Loading commit data...
audioOutput.h Loading commit data...
buffer2array.c Loading commit data...
buffer2array.h Loading commit data...
charConv.c Loading commit data...
charConv.h Loading commit data...
command.c Loading commit data...
command.h Loading commit data...
compress.c Loading commit data...
compress.h Loading commit data...
conf.c Loading commit data...
conf.h Loading commit data...
dbUtils.c Loading commit data...
dbUtils.h Loading commit data...
decode.c Loading commit data...
decode.h Loading commit data...
directory.c Loading commit data...
directory.h Loading commit data...
gcc.h Loading commit data...
inputPlugin.c Loading commit data...
inputPlugin.h Loading commit data...
inputStream.c Loading commit data...
inputStream.h Loading commit data...
inputStream_file.c Loading commit data...
inputStream_file.h Loading commit data...
inputStream_http.c Loading commit data...
inputStream_http.h Loading commit data...
interface.c Loading commit data...
interface.h Loading commit data...
ioops.h Loading commit data...
list.c Loading commit data...
list.h Loading commit data...
listen.c Loading commit data...
listen.h Loading commit data...
locate.c Loading commit data...
locate.h Loading commit data...
log.c Loading commit data...
log.h Loading commit data...
ls.c Loading commit data...
ls.h Loading commit data...
main.c Loading commit data...
metadataChunk.c Loading commit data...
metadataChunk.h Loading commit data...
mpd_types.h Loading commit data...
myfprintf.c Loading commit data...
myfprintf.h Loading commit data...
normalize.c Loading commit data...
normalize.h Loading commit data...
outputBuffer.c Loading commit data...
outputBuffer.h Loading commit data...
path.c Loading commit data...
path.h Loading commit data...
pcm_utils.c Loading commit data...
pcm_utils.h Loading commit data...
permission.c Loading commit data...
permission.h Loading commit data...
player.c Loading commit data...
player.h Loading commit data...
playerData.c Loading commit data...
playerData.h Loading commit data...
playlist.c Loading commit data...
playlist.h Loading commit data...
replayGain.c Loading commit data...
replayGain.h Loading commit data...
sig_handlers.c Loading commit data...
sig_handlers.h Loading commit data...
signal_check.c Loading commit data...
signal_check.h Loading commit data...
sllist.c Loading commit data...
sllist.h Loading commit data...
song.c Loading commit data...
song.h Loading commit data...
state_file.c Loading commit data...
state_file.h Loading commit data...
stats.c Loading commit data...
stats.h Loading commit data...
storedPlaylist.c Loading commit data...
storedPlaylist.h Loading commit data...
tag.c Loading commit data...
tag.h Loading commit data...
tagTracker.c Loading commit data...
tagTracker.h Loading commit data...
timer.c Loading commit data...
timer.h Loading commit data...
tree.c Loading commit data...
tree.h Loading commit data...
utf8.c Loading commit data...
utf8.h Loading commit data...
utils.c Loading commit data...
utils.h Loading commit data...
volume.c Loading commit data...
volume.h Loading commit data...
zeroconf.c Loading commit data...
zeroconf.h Loading commit data...