diff --git a/src/base/system.c b/src/base/system.c index 74a57378d..c9abe2793 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -1412,7 +1412,7 @@ int net_init() return 0; } -int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) +void fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) { #if defined(CONF_FAMILY_WINDOWS) WIN32_FIND_DATA finddata; @@ -1424,7 +1424,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) handle = FindFirstFileA(buffer, &finddata); if (handle == INVALID_HANDLE_VALUE) - return 0; + return; str_format(buffer, sizeof(buffer), "%s/", dir); length = str_length(buffer); @@ -1439,7 +1439,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) while (FindNextFileA(handle, &finddata)); FindClose(handle); - return 0; + return; #else struct dirent *entry; char buffer[1024*2]; @@ -1447,7 +1447,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) DIR *d = opendir(dir); if(!d) - return 0; + return; str_format(buffer, sizeof(buffer), "%s/", dir); length = str_length(buffer); @@ -1461,7 +1461,7 @@ int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user) /* close the directory and return */ closedir(d); - return 0; + return; #endif } diff --git a/src/base/system.h b/src/base/system.h index 803be0e43..b6d396c7d 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -1138,12 +1138,9 @@ void str_timestamp(char *buffer, int buffer_size); cb - Callback function to call for each entry type - Type of the directory user - Pointer to give to the callback - - Returns: - Always returns 0. */ typedef int (*FS_LISTDIR_CALLBACK)(const char *name, int is_dir, int dir_type, void *user); -int fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user); +void fs_listdir(const char *dir, FS_LISTDIR_CALLBACK cb, int type, void *user); /* Function: fs_makedir