source: remove unused function 98/155798/1
authorSooyoung Ha <yoosah.ha@samsung.com>
Mon, 16 Oct 2017 07:19:57 +0000 (16:19 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Mon, 16 Oct 2017 07:19:57 +0000 (16:19 +0900)
Change-Id: I8df28769edca2a8028ddcf984c630c28f5f04d5b
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
CMakeLists.txt
src/fileutils.c [deleted file]
src/fileutils.h [deleted file]
src/sdktools.c

index 3bc41e2..b839a10 100644 (file)
@@ -46,7 +46,6 @@ SET(SDBD_SRCS
         src/sdktools.c
         src/strutils.c
         src/init.c
-        src/fileutils.c
         src/commandline_sdbd.c
         src/usb_linux_client.c
         src/usb_funcfs_client.c
diff --git a/src/fileutils.c b/src/fileutils.c
deleted file mode 100644 (file)
index bb5071b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <limits.h>
-
-static int recurse(const char *path, mode_t mode, int (*fn)(const char *,mode_t, int)) {
-    struct stat st;
-    char dir[PATH_MAX];
-
-    if (path == NULL) {
-        return -1;
-    }
-    if (lstat (path, &st) == -1) {
-        return -1;
-    }
-    if (strrchr(path, '/') != NULL) {
-        int n = strlen(path)-strlen(strrchr(path, '/'));
-        if (n >= PATH_MAX) {
-            return -1;
-        }
-        strncpy(dir, path, n);
-        dir[n] = '\0';
-        fn(dir, mode,1);
-        return 1;
-    }
-    return -1;
-}
-
-int sdb_chmod(const char *path, mode_t mode, int recursive) {
-#ifdef HAVE_WIN32_PROC
-    fprintf(stderr, "error: sdb_chmod not implemented on Win32 (%s)\n", path);
-    return -1;
-#else
-    struct stat st;
-
-    if (stat (path, &st) == -1)
-        return -1;
-
-    if (chmod (path, mode) == -1) {
-        return -1;
-    }
-    if (recursive) {
-        return recurse(path, mode, sdb_chmod);
-    }
-    return 1;
-#endif
-}
diff --git a/src/fileutils.h b/src/fileutils.h
deleted file mode 100644 (file)
index 4debc92..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _FILEUTILS_H_
-#define _FILEUTILS_H_
-
-int sdb_chmod(const char *path, mode_t mode, int recursive);
-#endif
-
index 755625a..ddf4b18 100644 (file)
@@ -17,7 +17,6 @@
 #include "sdb.h"
 #include "sdktools.h"
 #include "strutils.h"
-#include "fileutils.h"
 #include "utils.h"
 
 struct sudo_command root_commands[] = {