Upload tizen_2.2 source
authorkh5325.kim <kh5325.kim@samsung.com>
Sun, 30 Jun 2013 05:43:43 +0000 (14:43 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Sun, 30 Jun 2013 05:43:43 +0000 (14:43 +0900)
Change-Id: I10d401d72edb39544a3ca689069b5100e0bc8a2d

package/changelog
package/pkginfo.manifest
src/command_function.c
src/libusb/windows.c
src/sdb.h

index a7a4359f65d9079bb47ac31dde4f1621aa4b2292..d649555f0db4c725abc65fd93438bb2cc2b04ff4 100644 (file)
@@ -1,3 +1,6 @@
+* 2.2.8
+- Fix window install bug
+== ho.namkoong <ho.namkoong@samsung.com> 2013-06-28
 * 2.2.7
 - rollback linux usb control
 == ho.namkoong <yoonki.park@samsung.com> 2013-06-25
index f69c325d9ebb0ac65eb7d72a8f4dda47a64acdf9..3f9548fbc6754bac72798f120debc3e4aa4836d6 100644 (file)
@@ -1,4 +1,4 @@
-Version:2.2.7
+Version:2.2.8
 Source:sdb
 Maintainer:Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park<yoonki.park@samsung.com>, Hyunsik Noh<hyunsik.noh@samsung.com>, Gun Kim<gune.kim@samsung.com>, Ho Namkoong<ho.namkoong@samsung.com>, Taeyoung Son<taeyoung2.son@samsung.com>
 
index 518dcbe5bf5e04c2add8b2a1330689f14e0c812b..47f3eb11db0c5e303eb09da4597353f5c30ed7eb 100644 (file)
@@ -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++;
index 1929a6c562e5225aff998d7d82b242679d8ded96..929ffcffe12b014449735d85e2afcb964fcb47af 100644 (file)
@@ -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;
index 98b5063e3f57d244fe097b0663af64bfb241fd96..16964b09e679772ebeebc469d7d518314a3fd689 100755 (executable)
--- 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;