diff --git a/libbbfdm-api/legacy/dmbbf.c b/libbbfdm-api/legacy/dmbbf.c index dd3d8c08..7fb1952c 100644 --- a/libbbfdm-api/legacy/dmbbf.c +++ b/libbbfdm-api/legacy/dmbbf.c @@ -348,7 +348,7 @@ static bool check_dependency(const char *conf_obj) char *token, *saveptr; for (token = strtok_r(conf_name, ",", &saveptr); token != NULL; token = strtok_r(NULL, ",", &saveptr)) { - if (!strcmp(pch, "file") && !bbfdm_file_nonzero(token)) + if (!strcmp(pch, "file") && !file_exists(token)) return false; if (!strcmp(pch, "ubus") && !dmubus_object_method_exists(token)) diff --git a/libbbfdm-api/version-2/bbfdm_system.c b/libbbfdm-api/version-2/bbfdm_system.c index 3d65f756..6e0ac8aa 100644 --- a/libbbfdm-api/version-2/bbfdm_system.c +++ b/libbbfdm-api/version-2/bbfdm_system.c @@ -35,22 +35,6 @@ bool bbfdm_file_exists(const char *path) return stat(path, &buffer) == 0; } -bool bbfdm_file_nonzero(const char *path) -{ - struct stat file_stats = {0}; - int ret; - - if (!path) - return false; - - ret = stat(path, &file_stats); - if ((ret == 0) && (file_stats.st_size != 0)) { - return true; - } - - return false; -} - bool bbfdm_is_regular_file(const char *path) { struct stat buffer; diff --git a/libbbfdm-api/version-2/bbfdm_system.h b/libbbfdm-api/version-2/bbfdm_system.h index 4c1dbdcf..e24d9d7d 100644 --- a/libbbfdm-api/version-2/bbfdm_system.h +++ b/libbbfdm-api/version-2/bbfdm_system.h @@ -36,17 +36,6 @@ bool bbfdm_folder_exists(const char *path); */ bool bbfdm_file_exists(const char *path); -/** - * @brief Check if a file exists at the given path. - * - * This function verifies the existence of a file at the specified path and also - * checks if file is not empty - * - * @param[in] path Path to the file. - * @return true if the file exists and non-empty, false otherwise. - */ -bool bbfdm_file_nonzero(const char *path); - /** * @brief Check if a file is a regular file. *