From: Jean-Philippe Orsini Date: Fri, 25 Apr 2014 08:37:24 +0000 (+0200) Subject: removed fts.h which is not needed for psensor and not compatible with LFS. X-Git-Tag: v1.0.1~39 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=26d8146c71a175f1bda27382dad9eebad3e6ab2b removed fts.h which is not needed for psensor and not compatible with LFS. --- diff --git a/src/lib/pio.c b/src/lib/pio.c index b7d3839..4a1a6ce 100644 --- a/src/lib/pio.c +++ b/src/lib/pio.c @@ -20,7 +20,6 @@ #include "config.h" #include -#include #include #include #include @@ -342,60 +341,3 @@ file_copy_print_error(int code, const char *src, const char *dst) printf("File copy error: unknown error %d.\n", code); } } - -int dir_rcopy(const char *src, const char *dst) -{ - int ret; - char **paths; - FTS *ftsp; - FTSENT *p, *chp; - int fts_options = FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOCHDIR; - char *p_dst, *n_dst; - - log_fct_enter(); - - log_fct("copy dir %s to %s", src, dst); - - paths = malloc(2 * sizeof(char *)); - paths[0] = strdup(src); - paths[1] = NULL; - - ftsp = fts_open(paths, fts_options, NULL); - if (!ftsp) - return 1; - - chp = fts_children(ftsp, 0); - if (!chp) - return 0; - - n_dst = dir_normalize(dst); - - while ((p = fts_read(ftsp)) != NULL) { - switch (p->fts_info) { - case FTS_D: - p_dst = path_append(n_dst, - p->fts_path + strlen(src) + 1); - mkdirs(p_dst, 0777); - free(p_dst); - break; - case FTS_F: - p_dst = path_append(n_dst, - p->fts_path + strlen(src) + 1); - file_copy(p->fts_path, p_dst); - free(p_dst); - break; - default: - break; - } - } - fts_close(ftsp); - - free(n_dst); - free(paths); - - ret = 0; - - log_fct_exit(); - - return ret; -}