diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-09-02 01:11:28 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-09-02 01:11:28 +0000 |
commit | bbe8b0efd884411247fca6b7366faf178bd0e0f4 (patch) | |
tree | 0eebd1788f7fd93cbd61e6abd8d93a9c650899b2 /src/mpd_types.h | |
parent | c2e742106f54ab6b82d9ca52d69f020b2fc9a5a7 (diff) | |
download | mpd-bbe8b0efd884411247fca6b7366faf178bd0e0f4.tar.gz mpd-bbe8b0efd884411247fca6b7366faf178bd0e0f4.tar.xz mpd-bbe8b0efd884411247fca6b7366faf178bd0e0f4.zip |
Fix endless loop when mpd is launched from a non-interactive shell.
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
Diffstat (limited to 'src/mpd_types.h')
0 files changed, 0 insertions, 0 deletions