diff options
author | marcus <marcus@FreeBSD.org> | 2007-02-27 15:17:52 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2007-02-27 15:17:52 +0800 |
commit | 99485558ded56caf54841d00839bc38ccb7e5848 (patch) | |
tree | 03ddeaa1395012281feee7ecb5b68df27bb6c9b5 /audio/esound/files | |
parent | e602439bc6087494ad33dddefadb9259a1edec31 (diff) | |
download | freebsd-ports-gnome-99485558ded56caf54841d00839bc38ccb7e5848.tar.gz freebsd-ports-gnome-99485558ded56caf54841d00839bc38ccb7e5848.tar.zst freebsd-ports-gnome-99485558ded56caf54841d00839bc38ccb7e5848.zip |
Fix a bug where esd could take 100% of the CPU when a client disconnected.
Diffstat (limited to 'audio/esound/files')
-rw-r--r-- | audio/esound/files/patch-players.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/audio/esound/files/patch-players.c b/audio/esound/files/patch-players.c new file mode 100644 index 000000000000..6a140b32b1b7 --- /dev/null +++ b/audio/esound/files/patch-players.c @@ -0,0 +1,20 @@ +--- players.c.orig Tue Feb 27 02:16:05 2007 ++++ players.c Tue Feb 27 02:16:37 2007 +@@ -310,13 +310,14 @@ int read_player( esd_player_t *player ) + player->data_buffer + player->actual_length, + player->buffer_length - player->actual_length, + actual, "str rd" ); +- if (bytes_read < player->buffer_length - player->actual_length) +- break; +- + /* check for end of stream */ + if ( actual == 0 + || ( actual < 0 && errno != EAGAIN && errno != EINTR ) ) + return -1; ++ ++ if (bytes_read < player->buffer_length - player->actual_length) ++ break; ++ + /* more data, save how much we got */ + if ( actual > 0 ) + player->actual_length += actual; |