From: kh5325.kim Date: Sun, 30 Jun 2013 05:43:43 +0000 (+0900) Subject: Upload tizen_2.2 source X-Git-Tag: 2.2.1_release~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bb84a93ba76472648d6436aa540fded87c57739;p=sdk%2Ftools%2Fsdb.git Upload tizen_2.2 source Change-Id: I10d401d72edb39544a3ca689069b5100e0bc8a2d --- diff --git a/package/changelog b/package/changelog index a7a4359..d649555 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,6 @@ +* 2.2.8 +- Fix window install bug +== ho.namkoong 2013-06-28 * 2.2.7 - rollback linux usb control == ho.namkoong 2013-06-25 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index f69c325..3f9548f 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version:2.2.7 +Version:2.2.8 Source:sdb Maintainer:Kangho Kim , Yoonki Park, Hyunsik Noh, Gun Kim, Ho Namkoong, Taeyoung Son diff --git a/src/command_function.c b/src/command_function.c index 518dcbe..47f3eb1 100644 --- a/src/command_function.c +++ b/src/command_function.c @@ -523,7 +523,7 @@ int install(int argc, char **argv, void** extargv) { const char* filename = sdb_dirstop(srcpath); char destination[PATH_MAX]; - strncat(destination, DIR_APP_TMP, PATH_MAX - 1 ); + snprintf(destination, PATH_MAX, "%s", DIR_APP_TMP ); if (filename) { filename++; diff --git a/src/libusb/windows.c b/src/libusb/windows.c index 1929a6c..929ffcf 100644 --- a/src/libusb/windows.c +++ b/src/libusb/windows.c @@ -336,18 +336,20 @@ int usb_find_devices(GUID deviceClassID) { if (!is_device_registered(devicePath)) { struct usb_handle *hnd = usb_open(devicePath); if (hnd != NULL) { - if (register_device(hnd)) { - char serial[256]; - if (get_serial_number(hnd, serial, sizeof(serial)) > 0) { - D("register usb for: %s\n", serial); + char serial[256]; + if (get_serial_number(hnd, serial, sizeof(serial)) > 0) { + D("register usb for: %s\n", serial); + if (register_device(hnd)) { register_usb_transport(hnd, serial, 1); } else { - D("fail to get usb serial name%s\n"); + D("fail to register usb\n"); win_usb_close(hnd); + free(hnd); } } else { - D("fail to register_new_device for %s\n", devicePath); + D("fail to get usb serial name: kick? close?\n"); win_usb_close(hnd); + free(hnd); } } } @@ -374,7 +376,7 @@ void sdb_usb_init() { sdb_thread_t tid; win_usb_init(); - if (sdb_thread_create(&tid, device_poll_thread, (void*)1000)) { + if (sdb_thread_create(&tid, device_poll_thread, (void*)3000)) { fatal_errno("cannot create input thread"); } } @@ -515,7 +517,8 @@ int sdb_usb_read(usb_handle *handle, void* data, int len) { return -1; } -void usb_cleanup_handle(usb_handle* handle) { +int win_usb_close(usb_handle *handle) { + D("+usb win_usb_close\n"); if (NULL != handle) { if (NULL != handle->fd) { WinUsb_Free(handle->fd); @@ -527,37 +530,22 @@ void usb_cleanup_handle(usb_handle* handle) { } handle = NULL; } -} - -int win_usb_close(usb_handle *handle) { - D("+usb win_usb_close\n"); - if (NULL != handle) { - usb_cleanup_handle(handle); - free(handle); - handle = NULL; - } D("-usb win_usb_close\n"); return 0; } void sdb_usb_kick(usb_handle* handle) { D("+sdb_usb_kick: %p\n", handle); - if (NULL != handle) { - sdb_mutex_lock(&usb_lock); - - usb_cleanup_handle(handle); - - sdb_mutex_unlock(&usb_lock); - } else { - SetLastError(ERROR_INVALID_HANDLE); - errno = ERROR_INVALID_HANDLE; - } + // called from transport remote kick if already registered + // so only clean for win usb handle resources + sdb_mutex_lock(&usb_lock); + win_usb_close(handle); + sdb_mutex_unlock(&usb_lock); D("-sdb_usb_kick: %p\n", handle); } int sdb_usb_close(usb_handle* handle) { D("+sdb_usb_close: %p\n", handle); - if (NULL != handle) { sdb_mutex_lock(&usb_lock); handle->next->prev = handle->prev; @@ -565,7 +553,7 @@ int sdb_usb_close(usb_handle* handle) { handle->prev = 0; handle->next = 0; sdb_mutex_unlock(&usb_lock); - win_usb_close(handle); + free(handle); } D("-sdb_usb_close: %p\n", handle); return 0; diff --git a/src/sdb.h b/src/sdb.h index 98b5063..16964b0 100755 --- a/src/sdb.h +++ b/src/sdb.h @@ -36,7 +36,7 @@ #define SDB_VERSION_MAJOR 2 // Used for help/version information #define SDB_VERSION_MINOR 2 // Used for help/version information -#define SDB_SERVER_VERSION 4 // Increment this when we want to force users to start a new sdb server +#define SDB_SERVER_VERSION 5 // Increment this when we want to force users to start a new sdb server typedef struct amessage amessage; typedef struct apacket apacket;