Move mmap_full_file from osl.c to fd.c.
[paraslash.git] / aft.c
diff --git a/aft.c b/aft.c
index b9db5a819fd13ebf7f780a0afdfe20d63cbc14f5..aae6d66b0bfbd511fb7a7aabbf14f2c1dbab74a7 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -6,6 +6,7 @@
 
 /** \file aft.c Audio file table functions. */
 
+#include <dirent.h> /* readdir() */
 #include "para.h"
 #include "error.h"
 #include "string.h"
@@ -15,6 +16,7 @@
 #include "afs.h"
 #include "net.h"
 #include "vss.h"
+#include "fd.h"
 
 static struct osl_table *audio_file_table;
 
@@ -638,7 +640,8 @@ int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data *
        ret = get_chunk_table_of_row(aft_row, &afd->afhi);
        if (ret < 0)
                return ret;
-       ret = mmap_full_file(afd->path, O_RDONLY, &afd->map);
+       ret = mmap_full_file(afd->path, O_RDONLY, &afd->map.data,
+               &afd->map.size, NULL);
        if (ret < 0)
                goto err;
        hash_function(afd->map.data, afd->map.size, file_hash);
@@ -1571,7 +1574,7 @@ static int add_one_audio_file(const char *path, const void *private_data)
                goto out_free;
        }
        /* We still want to add this file. Compute its hash. */
-       ret = mmap_full_file(path, O_RDONLY, &map);
+       ret = mmap_full_file(path, O_RDONLY, &map.data, &map.size, NULL);
        if (ret < 0)
                goto out_free;
        hash_function(map.data, map.size, hash);