Cosmetic changes, free root in tools/diskwrite.c
This commit is contained in:
parent
f507134706
commit
fb4dae6356
|
|
@ -5,6 +5,8 @@
|
|||
#define MODULE_NAME "KVFS"
|
||||
vfile_t root_dir = {"/", VFILE_DIRECTORY};
|
||||
|
||||
// !TODO: Modify code to become thread-safe
|
||||
|
||||
struct mount_handler{
|
||||
int (*callback)(vfile_t *device, MOUNT_OPERATION op, ...);
|
||||
uint32_t key;
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ void init(KOS_MAPI_FP module_api, uint32_t api_version){
|
|||
api(MODULE_API_ADDINT, 15, module_data.key, int_handler);
|
||||
api(MODULE_API_ADDINT, 14, module_data.key, int_handler);
|
||||
// api(MODULE_API_ADDINT, 0, module_data.key, int_handler);
|
||||
vfile_t *pci_drive_dir = fopen(api, "/dev/pci/disk/");
|
||||
vfile_t *pci_drive_dir = fget_file(api, "/dev/pci/disk/");
|
||||
vfile_t **dir_data = (pci_drive_dir->access.data.ptr);
|
||||
for(uint32_t i = 0; dir_data[i]; i++){
|
||||
vfile_t *current_file = dir_data[i];
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ int mount(vfile_t *file, char *buffer, uint32_t offset, uint32_t count){
|
|||
destination_buffer[i] = buffer[i];
|
||||
}
|
||||
destination_buffer[i] = 0;
|
||||
vfile_t *src = fopen(api, filename_buffer);
|
||||
vfile_t *src = fget_file(api, filename_buffer);
|
||||
if(!src){
|
||||
puts(api, MODULE_NAME, "src does not exist\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ inline void *free(KOS_MAPI_FP api, void *ptr){
|
|||
api(MODULE_API_FREE, ptr);
|
||||
return 0;
|
||||
}
|
||||
inline vfile_t *fopen(KOS_MAPI_FP api, char *filename){
|
||||
inline vfile_t *fget_file(KOS_MAPI_FP api, char *filename){
|
||||
// vfile_t *file = malloc(api, 1);
|
||||
return (void *)api(MODULE_API_OPEN, filename);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ int main(int argc, char **argv){
|
|||
printf(".%s\n", root[index].ext);
|
||||
index++;
|
||||
}
|
||||
// free(root);
|
||||
free(root);
|
||||
}
|
||||
fat_write_back(output_file, &info);
|
||||
verbose && printf("Finished. Exiting...\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue