Revert "depcheck to check non-zero file"

This commit is contained in:
Vivek Dutta 2025-05-27 19:53:16 +05:30 committed by IOPSYS Dev
parent 6cbfa27973
commit dd0c6433aa
No known key found for this signature in database
3 changed files with 1 additions and 28 deletions

View file

@ -348,7 +348,7 @@ static bool check_dependency(const char *conf_obj)
char *token, *saveptr; char *token, *saveptr;
for (token = strtok_r(conf_name, ",", &saveptr); token != NULL; token = strtok_r(NULL, ",", &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; return false;
if (!strcmp(pch, "ubus") && !dmubus_object_method_exists(token)) if (!strcmp(pch, "ubus") && !dmubus_object_method_exists(token))

View file

@ -35,22 +35,6 @@ bool bbfdm_file_exists(const char *path)
return stat(path, &buffer) == 0; 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) bool bbfdm_is_regular_file(const char *path)
{ {
struct stat buffer; struct stat buffer;

View file

@ -36,17 +36,6 @@ bool bbfdm_folder_exists(const char *path);
*/ */
bool bbfdm_file_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. * @brief Check if a file is a regular file.
* *