mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Revert "depcheck to check non-zero file"
This commit is contained in:
parent
6cbfa27973
commit
dd0c6433aa
3 changed files with 1 additions and 28 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue