mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-13 13:29:58 -05:00
Merge Pierre's changes
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@445 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
80ae72ce45
commit
f7a99e9047
65 changed files with 3786 additions and 1050 deletions
|
|
@ -28,6 +28,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "winsock.h"
|
||||
|
||||
#include "iochannel.h"
|
||||
#include "util.h"
|
||||
#include "socket-util.h"
|
||||
|
|
@ -189,7 +191,19 @@ ssize_t pa_iochannel_write(struct pa_iochannel*io, const void*data, size_t l) {
|
|||
ssize_t r;
|
||||
assert(io && data && l && io->ofd >= 0);
|
||||
|
||||
if ((r = write(io->ofd, data, l)) >= 0) {
|
||||
#ifdef OS_IS_WIN32
|
||||
r = send(io->ofd, data, l, 0);
|
||||
if (r < 0) {
|
||||
if (WSAGetLastError() != WSAENOTSOCK) {
|
||||
errno = WSAGetLastError();
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
if (r < 0)
|
||||
#endif
|
||||
r = write(io->ofd, data, l);
|
||||
if (r >= 0) {
|
||||
io->writable = 0;
|
||||
enable_mainloop_sources(io);
|
||||
}
|
||||
|
|
@ -201,7 +215,19 @@ ssize_t pa_iochannel_read(struct pa_iochannel*io, void*data, size_t l) {
|
|||
ssize_t r;
|
||||
assert(io && data && io->ifd >= 0);
|
||||
|
||||
if ((r = read(io->ifd, data, l)) >= 0) {
|
||||
#ifdef OS_IS_WIN32
|
||||
r = recv(io->ifd, data, l, 0);
|
||||
if (r < 0) {
|
||||
if (WSAGetLastError() != WSAENOTSOCK) {
|
||||
errno = WSAGetLastError();
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
if (r < 0)
|
||||
#endif
|
||||
r = read(io->ifd, data, l);
|
||||
if (r >= 0) {
|
||||
io->readable = 0;
|
||||
enable_mainloop_sources(io);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue