diff options
author | petr@mysql.com <> | 2005-07-08 14:43:27 +0400 |
---|---|---|
committer | petr@mysql.com <> | 2005-07-08 14:43:27 +0400 |
commit | 5d6365d0a30e9865c387c3290d4d8697690e58ee (patch) | |
tree | b2b1b08d50e23462741566df538febb29002de89 /sql/examples | |
parent | e98959dfbe445e27c67e343cef7091d9b471ed26 (diff) | |
download | mariadb-git-5d6365d0a30e9865c387c3290d4d8697690e58ee.tar.gz |
Apply Guilhem's patch (mmap->my_mmap, munmap->my_munmap in ha_tina) to improve
portability.
Diffstat (limited to 'sql/examples')
-rw-r--r-- | sql/examples/ha_tina.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index a030960d08a..8680d683a2f 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -79,7 +79,8 @@ static byte* tina_get_key(TINA_SHARE *share,uint *length, int get_mmap(TINA_SHARE *share, int write) { DBUG_ENTER("ha_tina::get_mmap"); - if (share->mapped_file && munmap(share->mapped_file, share->file_stat.st_size)) + if (share->mapped_file && my_munmap(share->mapped_file, + share->file_stat.st_size)) DBUG_RETURN(1); if (my_fstat(share->data_file, &share->file_stat, MYF(MY_WME)) == -1) @@ -88,13 +89,13 @@ int get_mmap(TINA_SHARE *share, int write) if (share->file_stat.st_size) { if (write) - share->mapped_file= (byte *)mmap(NULL, share->file_stat.st_size, - PROT_READ|PROT_WRITE, MAP_SHARED, - share->data_file, 0); + share->mapped_file= (byte *)my_mmap(NULL, share->file_stat.st_size, + PROT_READ|PROT_WRITE, MAP_SHARED, + share->data_file, 0); else - share->mapped_file= (byte *)mmap(NULL, share->file_stat.st_size, - PROT_READ, MAP_PRIVATE, - share->data_file, 0); + share->mapped_file= (byte *)my_mmap(NULL, share->file_stat.st_size, + PROT_READ, MAP_PRIVATE, + share->data_file, 0); if ((share->mapped_file ==(caddr_t)-1)) { /* @@ -202,7 +203,7 @@ static int free_share(TINA_SHARE *share) if (!--share->use_count){ /* Drop the mapped file */ if (share->mapped_file) - munmap(share->mapped_file, share->file_stat.st_size); + my_munmap(share->mapped_file, share->file_stat.st_size); result_code= my_close(share->data_file,MYF(0)); hash_delete(&tina_open_tables, (byte*) share); thr_lock_delete(&share->lock); @@ -760,7 +761,7 @@ int ha_tina::rnd_end() if (my_chsize(share->data_file, length, 0, MYF(MY_WME))) DBUG_RETURN(-1); - if (munmap(share->mapped_file, length)) + if (my_munmap(share->mapped_file, length)) DBUG_RETURN(-1); /* We set it to null so that get_mmap() won't try to unmap it */ |