aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-pipe-net.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-08-26 15:19:25 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-08-29 13:35:00 +0200
commit6a8b698fff4d328c2706776c1c09171cfadb8de4 (patch)
tree1c886d87699377db5469242ab289258c635abf1c /android/hw-pipe-net.c
parent81aafe2f4151be660b5c48c153df596c2767cc4f (diff)
downloadexternal_qemu-6a8b698fff4d328c2706776c1c09171cfadb8de4.zip
external_qemu-6a8b698fff4d328c2706776c1c09171cfadb8de4.tar.gz
external_qemu-6a8b698fff4d328c2706776c1c09171cfadb8de4.tar.bz2
Fix a crash when GPU emulation doesn't work.
This patch fixes a simple segmentation fault in the case where we can't connect to the GPU emulation rendering library. Change-Id: I47df0cae9029aee4738fd89083750e3baca5f032
Diffstat (limited to 'android/hw-pipe-net.c')
-rw-r--r--android/hw-pipe-net.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/android/hw-pipe-net.c b/android/hw-pipe-net.c
index 2a09718..dd8c8b1 100644
--- a/android/hw-pipe-net.c
+++ b/android/hw-pipe-net.c
@@ -466,21 +466,23 @@ openglesPipe_init( void* hwpipe, void* _looper, const char* args )
snprintf(temp, sizeof temp, "%d", DEFAULT_OPENGLES_PORT);
pipe = (NetPipe *)netPipe_initTcp(hwpipe, _looper, temp);
- // Disable TCP nagle algorithm to improve throughput of small packets
- socket_set_nodelay(pipe->io->fd);
+ if (pipe != NULL) {
+ // Disable TCP nagle algorithm to improve throughput of small packets
+ socket_set_nodelay(pipe->io->fd);
// On Win32, adjust buffer sizes
#ifdef _WIN32
- {
- int sndbuf = 128 * 1024;
- int len = sizeof(sndbuf);
- if (setsockopt(pipe->io->fd, SOL_SOCKET, SO_SNDBUF,
- (char*)&sndbuf, len) == SOCKET_ERROR) {
- D("Failed to set SO_SNDBUF to %d error=0x%x\n",
- sndbuf, WSAGetLastError());
+ {
+ int sndbuf = 128 * 1024;
+ int len = sizeof(sndbuf);
+ if (setsockopt(pipe->io->fd, SOL_SOCKET, SO_SNDBUF,
+ (char*)&sndbuf, len) == SOCKET_ERROR) {
+ D("Failed to set SO_SNDBUF to %d error=0x%x\n",
+ sndbuf, WSAGetLastError());
+ }
}
- }
#endif /* _WIN32 */
+ }
return pipe;
}