fix potential bugs 28/104828/2 accepted/tizen/3.0/common/20161219.112500 accepted/tizen/3.0/ivi/20161219.063905 accepted/tizen/3.0/mobile/20161219.063850 accepted/tizen/3.0/tv/20161219.063913 accepted/tizen/3.0/wearable/20161219.063835 submit/tizen_3.0/20161214.111143
authorgreatim <jaewon81.lim@samsung.com>
Wed, 14 Dec 2016 08:28:38 +0000 (17:28 +0900)
committergreatim <jaewon81.lim@samsung.com>
Wed, 14 Dec 2016 10:53:56 +0000 (19:53 +0900)
remove unnecessary files and code (properties.h and properties.c)
fix double close problem of socket pair in file_sync_service.c
remove unnecessary manifest file

Change-Id: Ic61ca8ffab9e1ee31f3a432acf0e9c138fc26fbe
Signed-off-by: greatim <jaewon81.lim@samsung.com>
CMakeLists.txt
sdbd.manifest [deleted file]
src/file_sync_service.c
src/properties.c [deleted file]
src/properties.h [deleted file]
src/sdb.c
src/services.c
src/sysdeps.h
src/transport_local.c

index 83b0a0a..e16df2d 100644 (file)
@@ -43,7 +43,6 @@ SET(SDBD_SRCS
        src/socket_loopback_client.c
        src/socket_loopback_server.c
        src/socket_network_client.c
-       src/properties.c
        src/sdktools.c
        src/strutils.c
        src/init.c
diff --git a/sdbd.manifest b/sdbd.manifest
deleted file mode 100644 (file)
index 1effc20..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<manifest>
-    <define>
-        <domain name="sdbd" policy="shared" />
-        <provide>
-            <label name="sdbd::home" />
-        </provide>
-        <request>
-            <smack request="sys-assert::core" type="rwxat" />
-            <smack request="device::app_logging" type="rwxat" />
-            <smack request="device::sys_logging" type="rwxat" />
-            <smack request="pkgmgr" type="rx" />
-            <smack request="pkgmgr::svc" type="rx" />
-            <smack request="pkgmgr::info" type="r" />
-            <smack request="pkgmgr-server" type="r" />
-            <smack request="pkgmgr-client" type="r" />
-            <smack request="aul" type="rx" />
-            <smack request="wrt::wrt-launcher" type="rx" />
-            <smack request="system::media" type="rwxat" />
-            <smack request="sdbd::home" type="rwxat" />
-            <smack request="dbus" type="rwx" />
-            <smack request="system::use_internet" type="w" />
-            <smack request="system::debugging_network" type="w" />
-            <smack request="device::input" type="rwx" />
-            <smack request="*" type="rwxat" />
-            <smack request="tizen::vconf::platform::rw" type="r" />
-            <smack request="tizen::vconf::public::r::platform::rw" type="r" />
-            <smack request="tizen::vconf::setting::admin" type="r" />
-            <smack request="procps" type="rx" />
-            <smack request="security-server::label" type="w" />
-        </request>
-        <permit>
-            <smack permit="system::use_internet" type="w" />
-            <smack permit="system::debugging_network" type="w" />
-            <smack permit="aul" type="rx" />
-            <smack permit="wrt::wrt-launcher" type="rw" />
-        </permit>
-    </define>
-    <assign>
-        <filesystem path="/usr/lib/*" label="_" exec_label="none"/>
-    </assign>
-    <request>
-        <domain name="sdbd" />
-    </request>
-</manifest>
index 6c418a5..9377078 100644 (file)
@@ -637,27 +637,30 @@ void file_sync_service(int fd, void *cookie)
         D("cannot create service socket pair\n");
         exit(-1);
     }
-    char *buffer = malloc(SYNC_DATA_MAX);
-    if(buffer == 0) {
-        goto fail;
-    }
-
-    FD_ZERO(&set); /* clear the set */
-    FD_SET(fd, &set); /* add our file descriptor to the set */
-
-    timeout.tv_sec = SYNC_TIMEOUT;
-    timeout.tv_usec = 0;
 
     pid_t pid = fork();
 
     if (pid == 0) {
         sdb_close(s[0]); //close the parent fd
         sync_read_label_notify(s[1]);
+        return;
     } else if (pid > 0) {
         sdb_close(s[1]);
+
+        char *buffer = malloc(SYNC_DATA_MAX);
+        if(buffer == NULL) {
+            goto fail;
+        }
+
         for(;;) {
             D("sync: waiting for command for %d sec\n", SYNC_TIMEOUT);
 
+            FD_ZERO(&set); /* clear the set */
+            FD_SET(fd, &set); /* add our file descriptor to the set */
+
+            timeout.tv_sec = SYNC_TIMEOUT;
+            timeout.tv_usec = 0;
+
             rv = select(fd + 1, &set, NULL, NULL, &timeout);
             if (rv == -1) {
                 D("sync file descriptor select failed\n");
@@ -713,15 +716,15 @@ void file_sync_service(int fd, void *cookie)
                 goto fail;
             }
         }
+
+fail:
+        if(buffer != NULL) {
+            free(buffer);
+        }
     } else {
         sdb_close(s[1]);
     }
 
-
-fail:
-    if(buffer != 0) {
-        free(buffer);
-    }
     D("sync: done\n");
     sync_send_label_notify(s[0], name, 0);
     sdb_close(s[0]);
diff --git a/src/properties.c b/src/properties.c
deleted file mode 100644 (file)
index aa14fe7..0000000
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "sockets.h"
-#include <errno.h>
-#include <assert.h>
-
-#include "properties.h"
-//#include "loghack.h"
-#include "sysdeps.h"
-#define  TRACE_TAG   TRACE_PROPERTIES
-#include "log.h"
-
-#include "sdb.h"
-
-#define HAVE_TIZEN_PROPERTY
-
-#ifdef HAVE_TIZEN_PROPERTY
-
-#define HAVE_PTHREADS
-#include <stdio.h>
-#include "strutils.h"
-#include "threads.h"
-
-static mutex_t  env_lock = MUTEX_INITIALIZER;
-
-#define TIZEN_PROPERTY_FILE       "/tmp/.sdb.conf" /* tizen specific*/
-#define PROPERTY_SEPARATOR "="
-
-struct config_node {
-    char *key;
-    char value[PROPERTY_VALUE_MAX];
-} sdbd_config[] = {
-    { "service.sdb.tcp.port", "0" },
-    { NULL, "" }
-};
-int sdbd_config_element_cnt = sizeof(sdbd_config) / sizeof(sdbd_config[0]);
-
-void property_save();
-
-static void property_init(void)
-{
-    int fd;
-    int i = 0;
-    char buffer[PROPERTY_KEY_MAX+PROPERTY_VALUE_MAX+1];
-    char *tok = NULL;
-    char *ptr;
-
-    fd = unix_open(TIZEN_PROPERTY_FILE, O_RDONLY);
-    if (fd < 0)
-        return;
-    for(;;) {
-        if(read_line(fd, buffer, PROPERTY_KEY_MAX+PROPERTY_VALUE_MAX+1) < 0)
-            break;
-        tok = strtok_r(buffer, PROPERTY_SEPARATOR, &ptr);
-        if(tok) {
-            for (i = 0; i < sdbd_config_element_cnt && sdbd_config[i].key ; i++) {
-                if (!strcmp(tok, sdbd_config[i].key)) {
-                    tok = strtok_r(NULL, PROPERTY_SEPARATOR, &ptr);
-                    if(tok) {
-                        snprintf(sdbd_config[i].value, PROPERTY_VALUE_MAX, "%s", tok);
-                        D("property init key=%s, value=%s\n", sdbd_config[i].key, tok);
-                    }
-                }
-            }
-        }
-    }
-    sdb_close(fd);
-    D("called property_init\n");
-}
-
-void property_save()
-{
-    int fd;
-    int i = 0;
-    char buffer[PROPERTY_KEY_MAX+PROPERTY_VALUE_MAX+1];
-
-    mutex_lock(&env_lock);
-    if (access(TIZEN_PROPERTY_FILE, F_OK) == 0) // if exist
-        sdb_unlink(TIZEN_PROPERTY_FILE);
-
-    fd = unix_open(TIZEN_PROPERTY_FILE, O_WRONLY | O_CREAT | O_APPEND, 0640);
-    if (fd <0 ) {
-        mutex_unlock(&env_lock);
-        return;
-    }
-
-    for (i = 0; i < sdbd_config_element_cnt && sdbd_config[i].key; i++) {
-        snprintf(buffer, sizeof(buffer), "%s%s%s\n", sdbd_config[i].key, PROPERTY_SEPARATOR, sdbd_config[i].value);
-        sdb_write(fd, buffer, strlen(buffer));
-    }
-    sdb_close(fd);
-    mutex_unlock(&env_lock);
-}
-
-int property_set(const char *key, const char *value)
-{
-    int i = 0;
-
-    mutex_lock(&env_lock);
-
-    for (i = 0; i < sdbd_config_element_cnt && sdbd_config[i].key; i++) {
-        if (!strcmp(key,sdbd_config[i].key)) {
-            snprintf(sdbd_config[i].value, PROPERTY_VALUE_MAX, "%s", value);
-            D("property set key=%s, value=%s\n", key, value);
-            break;
-        }
-    }
-    mutex_unlock(&env_lock);
-    property_save();
-    return -1;
-}
-
-int property_get(const char *key, char *value, const char *default_value)
-{
-    int len = 0;
-    int i = 0;
-
-    property_init();
-    mutex_lock(&env_lock);
-
-    for (i = 0; i < sdbd_config_element_cnt && sdbd_config[i].key; i++) {
-        if (!strcmp(key,sdbd_config[i].key)) {
-            len = strlen(sdbd_config[i].value);
-            memcpy(value, sdbd_config[i].value, len + 1);
-            D("property get key=%s, value=%s\n", key, value);
-            mutex_unlock(&env_lock);
-            return len;
-        }
-    }
-
-    if(default_value) {
-        len = strlen(default_value);
-        memcpy(value, default_value, len + 1);
-        D("by default, property get key=%s, value=%s\n", key, value);
-    }
-    mutex_unlock(&env_lock);
-    return len;
-}
-
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie),
-                  void *cookie)
-{
-    return 0;
-}
-
-#elif defined(HAVE_LIBC_SYSTEM_PROPERTIES)
-
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-//#include <sys/_system_properties.h>
-
-int property_set(const char *key, const char *value)
-{
-    return __system_property_set(key, value);
-}
-
-int property_get(const char *key, char *value, const char *default_value)
-{
-    int len;
-
-    len = __system_property_get(key, value);
-    if(len > 0) {
-        return len;
-    }
-
-    if(default_value) {
-        len = strlen(default_value);
-        memcpy(value, default_value, len + 1);
-    }
-    return len;
-}
-
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie),
-                  void *cookie)
-{
-    char name[PROP_NAME_MAX];
-    char value[PROP_VALUE_MAX];
-    const prop_info *pi;
-    unsigned n;
-
-    for(n = 0; (pi = __system_property_find_nth(n)); n++) {
-        __system_property_read(pi, name, value);
-        propfn(name, value, cookie);
-    }
-    return 0;
-}
-
-#elif defined(HAVE_SYSTEM_PROPERTY_SERVER)
-
-/*
- * The Linux simulator provides a "system property server" that uses IPC
- * to set/get/list properties.  The file descriptor is shared by all
- * threads in the process, so we use a mutex to ensure that requests
- * from multiple threads don't get interleaved.
- */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <pthread.h>
-
-static pthread_once_t gInitOnce = PTHREAD_ONCE_INIT;
-static pthread_mutex_t gPropertyFdLock = PTHREAD_MUTEX_INITIALIZER;
-static int gPropFd = -1;
-
-/*
- * Connect to the properties server.
- *
- * Returns the socket descriptor on success.
- */
-static int connectToServer(const char* fileName)
-{
-    int sock = -1;
-    int cc;
-
-    struct sockaddr_un addr;
-
-    sock = socket(AF_UNIX, SOCK_STREAM, 0);
-    if (sock < 0) {
-        D("UNIX domain socket create failed (errno=%d)\n", errno);
-        return -1;
-    }
-
-    /* connect to socket; fails if file doesn't exist */
-    strcpy(addr.sun_path, fileName);    // max 108 bytes
-    addr.sun_family = AF_UNIX;
-    cc = connect(sock, (struct sockaddr*) &addr, SUN_LEN(&addr));
-    if (cc < 0) {
-        // ENOENT means socket file doesn't exist
-        // ECONNREFUSED means socket exists but nobody is listening
-        D("AF_UNIX connect failed for '%s': errno:%d\n",
-            fileName, errno);
-        sdb_close(sock);
-        return -1;
-    }
-
-    return sock;
-}
-
-/*
- * Perform one-time initialization.
- */
-static void init(void)
-{
-    assert(gPropFd == -1);
-
-    gPropFd = connectToServer(SYSTEM_PROPERTY_PIPE_NAME);
-    if (gPropFd < 0) {
-        D("not connected to system property server\n");
-    } else {
-        D("Connected to system property server\n");
-    }
-}
-
-int property_get(const char *key, char *value, const char *default_value)
-{
-    char sendBuf[1+PROPERTY_KEY_MAX];
-    char recvBuf[1+PROPERTY_VALUE_MAX];
-    int len = -1;
-
-    D("PROPERTY GET [%s]\n", key);
-
-    pthread_once(&gInitOnce, init);
-    if (gPropFd < 0) {
-        /* this mimics the behavior of the device implementation */
-        if (default_value != NULL) {
-            strcpy(value, default_value);
-            len = strlen(value);
-        }
-        return len;
-    }
-
-    if (strlen(key) >= PROPERTY_KEY_MAX) return -1;
-
-    memset(sendBuf, 0xdd, sizeof(sendBuf));    // placate valgrind
-
-    sendBuf[0] = (char) kSystemPropertyGet;
-    strcpy(sendBuf+1, key);
-
-    pthread_mutex_lock(&gPropertyFdLock);
-    if (sdb_write(gPropFd, sendBuf, sizeof(sendBuf)) != sizeof(sendBuf)) {
-        pthread_mutex_unlock(&gPropertyFdLock);
-        return -1;
-    }
-    if (sdb_read(gPropFd, recvBuf, sizeof(recvBuf)) != sizeof(recvBuf)) {
-        pthread_mutex_unlock(&gPropertyFdLock);
-        return -1;
-    }
-    pthread_mutex_unlock(&gPropertyFdLock);
-
-    /* first byte is 0 if value not defined, 1 if found */
-    if (recvBuf[0] == 0) {
-        if (default_value != NULL) {
-            strcpy(value, default_value);
-            len = strlen(value);
-        } else {
-            /*
-             * If the value isn't defined, hand back an empty string and
-             * a zero length, rather than a failure.  This seems wrong,
-             * since you can't tell the difference between "undefined" and
-             * "defined but empty", but it's what the device does.
-             */
-            value[0] = '\0';
-            len = 0;
-        }
-    } else if (recvBuf[0] == 1) {
-        strcpy(value, recvBuf+1);
-        len = strlen(value);
-    } else {
-        D("Got strange response to property_get request (%d)\n",
-            recvBuf[0]);
-        assert(0);
-        return -1;
-    }
-    D("PROP [found=%d def='%s'] (%d) [%s]: [%s]\n",
-        recvBuf[0], default_value, len, key, value);
-
-    return len;
-}
-
-
-int property_set(const char *key, const char *value)
-{
-    char sendBuf[1+PROPERTY_KEY_MAX+PROPERTY_VALUE_MAX];
-    char recvBuf[1];
-    int result = -1;
-
-    D("PROPERTY SET [%s]: [%s]\n", key, value);
-
-    pthread_once(&gInitOnce, init);
-    if (gPropFd < 0)
-        return -1;
-
-    if (strlen(key) >= PROPERTY_KEY_MAX) return -1;
-    if (strlen(value) >= PROPERTY_VALUE_MAX) return -1;
-
-    memset(sendBuf, 0xdd, sizeof(sendBuf));    // placate valgrind
-
-    sendBuf[0] = (char) kSystemPropertySet;
-    strcpy(sendBuf+1, key);
-    strcpy(sendBuf+1+PROPERTY_KEY_MAX, value);
-
-    pthread_mutex_lock(&gPropertyFdLock);
-    if (sdb_write(gPropFd, sendBuf, sizeof(sendBuf)) != sizeof(sendBuf)) {
-        pthread_mutex_unlock(&gPropertyFdLock);
-        return -1;
-    }
-    if (sdb_read(gPropFd, recvBuf, sizeof(recvBuf)) != sizeof(recvBuf)) {
-        pthread_mutex_unlock(&gPropertyFdLock);
-        return -1;
-    }
-    pthread_mutex_unlock(&gPropertyFdLock);
-
-    if (recvBuf[0] != 1)
-        return -1;
-    return 0;
-}
-
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie),
-                  void *cookie)
-{
-    D("PROPERTY LIST\n");
-    pthread_once(&gInitOnce, init);
-    if (gPropFd < 0)
-        return -1;
-
-    return 0;
-}
-
-#else
-
-/* SUPER-cheesy place-holder implementation for Win32 */
-#define HAVE_PTHREADS /*tizen specific */
-#include <stdio.h>
-#include "threads.h"
-
-static mutex_t  env_lock = MUTEX_INITIALIZER;
-
-int property_get(const char *key, char *value, const char *default_value)
-{
-    char ename[PROPERTY_KEY_MAX + 6];
-    char *p;
-    int len;
-
-    len = strlen(key);
-    if(len >= PROPERTY_KEY_MAX) return -1;
-    memcpy(ename, "PROP_", 5);
-    memcpy(ename + 5, key, len + 1);
-
-    mutex_lock(&env_lock);
-
-    p = getenv(ename);
-    if(p == 0) p = "";
-    len = strlen(p);
-    if(len >= PROPERTY_VALUE_MAX) {
-        len = PROPERTY_VALUE_MAX - 1;
-    }
-
-    if((len == 0) && default_value) {
-        len = strlen(default_value);
-        memcpy(value, default_value, len + 1);
-    } else {
-        memcpy(value, p, len);
-        value[len] = 0;
-    }
-
-    mutex_unlock(&env_lock);
-    D("get [key=%s value='%s:%s']\n", key, ename, value);
-    return len;
-}
-
-
-int property_set(const char *key, const char *value)
-{
-    char ename[PROPERTY_KEY_MAX + 6];
-    char *p;
-    int len;
-    int r;
-
-    if(strlen(value) >= PROPERTY_VALUE_MAX) return -1;
-
-    len = strlen(key);
-    if(len >= PROPERTY_KEY_MAX) return -1;
-    memcpy(ename, "PROP_", 5);
-    memcpy(ename + 5, key, len + 1);
-
-    mutex_lock(&env_lock);
-#ifdef HAVE_MS_C_RUNTIME
-    {
-        char  temp[256];
-        snprintf( temp, sizeof(temp), "%s=%s", ename, value);
-        putenv(temp);
-        r = 0;
-    }
-#else
-    r = setenv(ename, value, 1);
-#endif
-    mutex_unlock(&env_lock);
-    D("set [key=%s value='%s%s']\n", key, ename, value);
-    return r;
-}
-
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie),
-                  void *cookie)
-{
-    return 0;
-}
-
-#endif
diff --git a/src/properties.h b/src/properties.h
deleted file mode 100644 (file)
index 08f9d18..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CUTILS_PROPERTIES_H
-#define __CUTILS_PROPERTIES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* System properties are *small* name value pairs managed by the
-** property service.  If your data doesn't fit in the provided
-** space it is not appropriate for a system property.
-**
-** WARNING: system/bionic/include/sys/system_properties.h also defines
-**          these, but with different names.  (TODO: fix that)
-*/
-#define PROPERTY_KEY_MAX   32
-#define PROPERTY_VALUE_MAX  92
-
-/* property_get: returns the length of the value which will never be
-** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated.
-** (the length does not include the terminating zero).
-**
-** If the property read fails or returns an empty value, the default
-** value is used (if nonnull).
-*/
-int property_get(const char *key, char *value, const char *default_value);
-
-/* property_set: returns 0 on success, < 0 on failure
-*/
-int property_set(const char *key, const char *value);
-
-int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie);
-
-#ifdef HAVE_SYSTEM_PROPERTY_SERVER
-/*
- * We have an external property server instead of built-in libc support.
- * Used by the simulator.
- */
-#define SYSTEM_PROPERTY_PIPE_NAME       "/tmp/sdb-sysporp"
-
-enum {
-    kSystemPropertyUnknown = 0,
-    kSystemPropertyGet,
-    kSystemPropertySet,
-    kSystemPropertyList
-};
-#endif /*HAVE_SYSTEM_PROPERTY_SERVER*/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index ac7f573..4eb7389 100644 (file)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -1196,11 +1196,6 @@ void start_device_log(void)
     const char* p_path = getenv("SDBD_LOG_PATH");
     // read the trace mask from persistent property persist.sdb.trace_mask
     // give up if the property is not set or cannot be parsed
-#if 0 /* tizen specific */
-    property_get("persist.sdb.trace_mask", value, "");
-    if (sscanf(value, "%x", &sdb_trace_mask) != 1)
-        return;
-#endif
 
     if ((p_trace == NULL ) && !is_enable_sdbd_log()) {
         return;
index 4395a1d..b0f2e08 100644 (file)
@@ -133,52 +133,8 @@ static void recover_service(int s, void *cookie)
     sdb_close(fd);
 }
 
-void restart_root_service(int fd, void *cookie)
-{
-    char buf[100];
-    char value[PROPERTY_VALUE_MAX];
-
-    if (getuid() == 0) {
-        snprintf(buf, sizeof(buf), "sdbd is already running as root\n");
-        writex(fd, buf, strlen(buf));
-        sdb_close(fd);
-    } else {
-        property_get("ro.debuggable", value, "");
-        if (strcmp(value, "1") != 0) {
-            snprintf(buf, sizeof(buf), "sdbd cannot run as root in production builds\n");
-            writex(fd, buf, strlen(buf));
-            sdb_close(fd);
-            return;
-        }
-
-        property_set("service.sdb.root", "1");
-        snprintf(buf, sizeof(buf), "restarting sdbd as root\n");
-        writex(fd, buf, strlen(buf));
-        sdb_close(fd);
-    }
-}
 #endif
 
-void restart_tcp_service(int fd, void *cookie)
-{
-    char buf[100];
-    char value[PROPERTY_VALUE_MAX];
-    int port = (int)cookie;
-
-    if (port <= 0) {
-        snprintf(buf, sizeof(buf), "invalid port\n");
-        writex(fd, buf, strlen(buf));
-        sdb_close(fd);
-        return;
-    }
-
-    snprintf(value, sizeof(value), "%d", port);
-    property_set("service.sdb.tcp.port", value);
-    snprintf(buf, sizeof(buf), "restarting in TCP mode port: %d\n", port);
-    writex(fd, buf, strlen(buf));
-    sdb_close(fd);
-}
-
 static int is_support_rootonoff()
 {
     return (!strncmp(g_capabilities.rootonoff_support, PLUGIN_RET_ENABLED, strlen(PLUGIN_RET_ENABLED)));
@@ -254,16 +210,6 @@ void get_tzplatform_env(int fd, void *cookie) {
     sdb_close(fd);
 }
 
-void restart_usb_service(int fd, void *cookie)
-{
-    char buf[100];
-
-    property_set("service.sdb.tcp.port", "0");
-    snprintf(buf, sizeof(buf), "restarting in USB mode\n");
-    writex(fd, buf, strlen(buf));
-    sdb_close(fd);
-}
-
 void reboot_service(int fd, void *arg)
 {
 #if 0
index d99a2d4..a72e798 100644 (file)
@@ -278,7 +278,6 @@ static __inline__  int  sdb_is_absolute_host_path( const char*  path )
 
 #include "fdevent.h"
 #include "sockets.h"
-#include "properties.h"
 // tizen specific #include <cutils/misc.h>
 #include <stdio.h>
 #include <signal.h>
index a6adb0b..ed61ec1 100644 (file)
@@ -612,14 +612,6 @@ void local_init(int port)
 #else
         /* For the sdbd daemon in the system image we need to distinguish
          * between the device, and the emulator. */
-#if 0 /* tizen specific */
-        char is_qemu[PROPERTY_VALUE_MAX];
-        property_get("ro.kernel.qemu", is_qemu, "");
-        if (!strcmp(is_qemu, "1")) {
-            /* Running inside the emulator: use QEMUD pipe as the transport. */
-            func = qemu_socket_thread;
-        } else
-#endif
         {
             /* Running inside the device: use TCP socket as the transport. */
             func = server_socket_thread;