struct file_info {
bool isdir;
- int size;
+ size_t size;
time_t mtime;
char *path;
};
return 0;
}
-static int scan_dump(struct file_info **dump_list, size_t *usage)
+static int scan_dump(struct file_info **dump_list, off_t *usage)
{
struct file_info *temp_list;
struct dirent **scan_list = NULL;
{
struct file_info *dump_list = NULL;
int i, scan_num, dump_num, remove_flag;
- size_t usage = 0;
+ off_t usage = 0;
time_t cur_time;
scan_num = scan_dump(&dump_list, &usage);
dump_list[i].path);
break;
case USAGE_EXCEED:
- _I("Reached the maximum disk usage %d/%d kb, so remove (%s)",
+ _I("Reached the maximum disk usage %lld/%d kb, so remove (%s)",
usage / 1024, system_max_use,
dump_list[i].path);
break;
return count;
}
-int get_directory_usage(char *path)
+off_t get_directory_usage(char *path)
{
DIR *dir;
struct dirent *de;
struct stat st;
- size_t usage = 0;
+ off_t usage = 0;
int fd = -1;
fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
int get_file_count(char *path);
-int get_directory_usage(char *path);
+off_t get_directory_usage(char *path);
int log_kmsg(char *fmt, ...);