mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 04:13:55 +01:00
Fix mmap when qp set_file has not been called
This commit is contained in:
parent
d77f48b63c
commit
38481ad2c0
@ -2,6 +2,8 @@ module mmap_module
|
|||||||
|
|
||||||
use iso_c_binding
|
use iso_c_binding
|
||||||
|
|
||||||
|
character*(256) :: mmap_prefix = '/tmp/'
|
||||||
|
|
||||||
type mmap_type
|
type mmap_type
|
||||||
type(c_ptr) :: ptr ! Pointer to the data
|
type(c_ptr) :: ptr ! Pointer to the data
|
||||||
character*(128) :: filename ! Name of the file
|
character*(128) :: filename ! Name of the file
|
||||||
@ -155,7 +157,15 @@ module mmap_module
|
|||||||
map%filename = filename
|
map%filename = filename
|
||||||
else
|
else
|
||||||
call getenv('EZFIO_FILE', map%filename)
|
call getenv('EZFIO_FILE', map%filename)
|
||||||
map%filename = trim(map%filename) // '/work/tmpfile'
|
if (trim(map%filename) /= '') then
|
||||||
|
map%filename = trim(map%filename) // '/work/'
|
||||||
|
else
|
||||||
|
call getenv('TMPDIR', map%filename)
|
||||||
|
if (trim(map%filename) == '') then
|
||||||
|
map%filename = '/tmp/'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
map%filename = trim(map%filename) // '/tmpfile'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
map%length = int(bytes,8)
|
map%length = int(bytes,8)
|
||||||
|
Loading…
Reference in New Issue
Block a user