diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-02-01 07:18:23 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-02-01 07:18:23 -0800 |
commit | f4d4ca164dea606cee27e1f68d4742a3c57b0954 (patch) | |
tree | 1d8d2bbc7d13742129a0faad57ea51931c2e0080 /android/protocol/core-commands-proxy.c | |
parent | a7880fe783781bbedf998916791ebd70fb252b88 (diff) | |
parent | 85276806ec6ac969d7befa2496c1de59adaaac74 (diff) | |
download | external_qemu-f4d4ca164dea606cee27e1f68d4742a3c57b0954.zip external_qemu-f4d4ca164dea606cee27e1f68d4742a3c57b0954.tar.gz external_qemu-f4d4ca164dea606cee27e1f68d4742a3c57b0954.tar.bz2 |
Merge "Refactor attach-UI service"
Diffstat (limited to 'android/protocol/core-commands-proxy.c')
-rw-r--r-- | android/protocol/core-commands-proxy.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/android/protocol/core-commands-proxy.c b/android/protocol/core-commands-proxy.c index 1bd0937..a52a376 100644 --- a/android/protocol/core-commands-proxy.c +++ b/android/protocol/core-commands-proxy.c @@ -120,27 +120,6 @@ _coreCmdProxy_get_response(UICmdRespHeader* resp, void** resp_data) return status; } -/* Destroys CoreCmdProxy instance. */ -static void -_coreCmdProxy_destroy(void) -{ - if (_coreCmdProxy.sync_writer != NULL) { - syncsocket_close(_coreCmdProxy.sync_writer); - syncsocket_free(_coreCmdProxy.sync_writer); - _coreCmdProxy.sync_writer = NULL; - } - if (_coreCmdProxy.sync_reader != NULL) { - syncsocket_close(_coreCmdProxy.sync_reader); - syncsocket_free(_coreCmdProxy.sync_reader); - _coreCmdProxy.sync_reader = NULL; - } - if (_coreCmdProxy.core_connection != NULL) { - core_connection_close(_coreCmdProxy.core_connection); - core_connection_free(_coreCmdProxy.core_connection); - _coreCmdProxy.core_connection = NULL; - } -} - int corecmd_set_coarse_orientation(AndroidCoarseOrientation orient) { @@ -351,13 +330,13 @@ coreCmdProxy_create(SockAddress* console_socket) _coreCmdProxy.sync_writer = syncsocket_init(_coreCmdProxy.sock); if (_coreCmdProxy.sync_writer == NULL) { derror("Unable to initialize CoreCmdProxy writer: %s\n", errno_str); - _coreCmdProxy_destroy(); + coreCmdProxy_destroy(); return -1; } _coreCmdProxy.sync_reader = syncsocket_init(_coreCmdProxy.sock); if (_coreCmdProxy.sync_reader == NULL) { derror("Unable to initialize CoreCmdProxy reader: %s\n", errno_str); - _coreCmdProxy_destroy(); + coreCmdProxy_destroy(); return -1; } @@ -374,3 +353,24 @@ coreCmdProxy_create(SockAddress* console_socket) return 0; } + +/* Destroys CoreCmdProxy instance. */ +void +coreCmdProxy_destroy(void) +{ + if (_coreCmdProxy.sync_writer != NULL) { + syncsocket_close(_coreCmdProxy.sync_writer); + syncsocket_free(_coreCmdProxy.sync_writer); + _coreCmdProxy.sync_writer = NULL; + } + if (_coreCmdProxy.sync_reader != NULL) { + syncsocket_close(_coreCmdProxy.sync_reader); + syncsocket_free(_coreCmdProxy.sync_reader); + _coreCmdProxy.sync_reader = NULL; + } + if (_coreCmdProxy.core_connection != NULL) { + core_connection_close(_coreCmdProxy.core_connection); + core_connection_free(_coreCmdProxy.core_connection); + _coreCmdProxy.core_connection = NULL; + } +} |