[Title]remove process.c
authormunkyu.im <munkyu.im@samsung.com>
Mon, 26 Mar 2012 12:10:47 +0000 (21:10 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Mon, 26 Mar 2012 12:10:47 +0000 (21:10 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/Makefile.tizen
tizen/src/emulator.c
tizen/src/process.c [deleted file]
tizen/src/process.h [deleted file]

index 3ec5bef..b6775b8 100755 (executable)
@@ -54,7 +54,7 @@ endif #($(TARGET_ARCH), i386)
 endif #CONFIG_WIN32
        
 # maru loader
-obj-y += emulator.o emul_state.o process.o option.o maru_signal.o
+obj-y += emulator.o emul_state.o option.o maru_signal.o
 
 # maru display
 obj-y += maru_sdl.o sdl_rotate.o maru_finger.o
index 55770fe..08567a1 100644 (file)
 #include "skin/maruskin_client.h"
 #include "guest_server.h"
 #include "debug_ch.h"
-#include "process.h"
 #include "option.h"
 #include "emul_state.h"
 #include "qemu_socket.h"
-
+#include <glib.h>
+#include <glib/gstdio.h>
 #ifdef _WIN32
 #include <winsock2.h>
 #endif
@@ -75,8 +75,6 @@ void exit_emulator(void)
     shutdown_guest_server();
 
     SDL_Quit();
-
-    remove_portfile();
 }
 
 static void construct_main_window(int skin_argc, char* skin_argv[])
@@ -192,7 +190,6 @@ void extract_info(int qemu_argc, char** qemu_argv)
     }
     
     tizen_base_port = get_sdb_base_port();
-    write_portfile(tizen_target_path);
 }
 
 static int skin_argc = 0;
diff --git a/tizen/src/process.c b/tizen/src/process.c
deleted file mode 100644 (file)
index 31108e4..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/* 
- * Emulator
- *
- * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * SeokYeon Hwang <syeon.hwang@samsung.com>
- * HyunJun Son <hj79.son@samsung.com>
- * MunKyu Im <munkyu.im@samsung.com>
- * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-#include "process.h"
-#ifndef _WIN32
-#include <wait.h>
-#else
-#include <stdlib.h>
-#endif
-#include <assert.h>
-
-//#include "fileio.h"
-#include "debug_ch.h"
-
-//DEFAULT_DEBUG_CHANNEL(tizen);
-MULTI_DEBUG_CHANNEL(tizen, process);
-
-static char portfname[512] = { 0, };
-char tizen_vms_path[512] = {0, };
-extern int tizen_base_port;
-#ifdef _WIN32
-static char *mbstok_r (char *string, const char *delim, char **save_ptr)
-{
-       if (MB_CUR_MAX > 1)
-       {
-               if (string == NULL)
-               {
-                       string = *save_ptr;
-                       if (string == NULL)
-                       return NULL; /* reminder that end of token sequence has been
-                           reached */
-               }
-
-               /* Skip leading delimiters.  */
-               string += _mbsspn (string, delim);
-
-               /* Found a token?  */
-               if (*string == '\0')
-               {
-                       *save_ptr = NULL;
-                       return NULL;
-               }
-
-               /* Move past the token.  */
-               {
-                       char *token_end = _mbspbrk (string, delim);
-
-                       if (token_end != NULL)
-                       {
-                               /* NUL-terminate the token.  */
-                               *token_end = '\0';
-                               *save_ptr = token_end + 1;
-                       }
-                       else
-                               *save_ptr = NULL;
-               }
-               return string;
-       }
-       else
-               return NULL;
-}
-#endif
-
-/**
- * @brief      make port directory
- * @param      portfname : port file name
- * @date    Nov 25. 2008
- * */ 
-
-static int make_port_path(const char *portfname)
-{
-       char dir[512] = "", buf[512] = "";
-       char *ptr, *last = NULL, *lptr = NULL;
-       int dirnamelen = 0;
-
-       sprintf(buf, "%s", portfname);
-#ifndef _WIN32 
-       lptr = ptr = strtok_r(buf+1, "/", &last);
-#else
-       lptr = ptr = mbstok_r(buf, "/", &last);
-#endif
-
-       for (;;) {
-#ifndef _WIN32
-               if ((ptr = strtok_r(NULL, "/", &last)) == NULL) break;
-#else
-               if ((ptr = mbstok_r(NULL, "/", &last)) == NULL) break;
-#endif
-               dirnamelen = strlen(lptr) + 1;
-
-               if (sizeof(dir) < dirnamelen) {
-                       return -1;
-               }
-#ifdef _WIN32
-               if (dir != NULL && strlen (dir) > 0) 
-#endif                 
-               strcat(dir, "/");
-               strcat(dir, lptr);
-
-#ifndef _WIN32
-               if (access(dir, R_OK) != 0) 
-                       mkdir(dir, S_IRWXU | S_IRWXG);
-#else
-        if (access(g_win32_locale_filename_from_utf8(dir), R_OK) != 0) 
-                       mkdir(g_win32_locale_filename_from_utf8(dir));          
-#endif
-               lptr = ptr;
-       }
-
-       return 0;
-}
-
-
-/**
- * @brief      wirte port file
- * @param      mod: emulator, vinit
- * @date    Nov 25. 2008
- * */
-
-int write_portfile(char *path)
-{
-       int             fd = -1;
-       char    buf[128] = "";
-    
-    if(tizen_base_port == 0)
-        return 0;
-
-    if(!g_path_is_absolute(path))
-        strcpy(tizen_vms_path, g_get_current_dir());
-    else
-        strcpy(tizen_vms_path, g_path_get_dirname(path));
-
-    sprintf(portfname, "%s/.port", tizen_vms_path);
-
-       if (access(tizen_vms_path, R_OK) != 0) {
-               make_port_path(portfname);
-       }
-#ifdef _WIN32
-       if ((fd = open(g_win32_locale_filename_from_utf8(portfname), O_RDWR | O_CREAT, 0666)) < 0) {
-#else
-       if ((fd = open(portfname, O_RDWR | O_CREAT, 0666)) < 0) {
-#endif
-               ERR("Failed to create .port file\n");
-               ERR("%s at %s(%d)\n", strerror(errno), __FILE__, __LINE__);
-           return -1;
-       }
-
-       ftruncate(fd, 0);
-       memset(buf, 0, sizeof(buf));
-       sprintf(buf, "%d", tizen_base_port);
-       write(fd, buf, strlen(buf));
-
-       close(fd);
-
-       return 0;
-}
-
-/**
- * @brief      remove port file
- * @param      mod: emulator, vinit
- * @date    Nov 25. 2008
- * */
-
-int remove_portfile(void)
-{
-       if (strlen(portfname) <= 0) {
-               return -1;
-       }
-
-#ifdef _WIN32
-    if (remove(g_win32_locale_filename_from_utf8(portfname)) < 0) {
-#else
-       if (remove(portfname) < 0) {
-#endif
-               ERR( "Can't remove port file. (%s)\n", portfname);
-       }
-
-       return 0;
-}
diff --git a/tizen/src/process.h b/tizen/src/process.h
deleted file mode 100644 (file)
index 59c972f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* 
- * Emulator
- *
- * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * SeokYeon Hwang <syeon.hwang@samsung.com>
- * HyunJun Son <hj79.son@samsung.com>
- * MunKyu Im <munkyu.im@samsung.com>
- * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-#ifndef PROCESS_H
-#define PROCESS_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <strings.h>
-#include <glib.h>
-#include <glib/gstdio.h>
-
-int write_portfile(char *path);
-int remove_portfile(void);
-
-#ifdef _WIN32
-#include <windows.h>
-#include <mbstring.h>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif