It's not necessary to initialize ->fd at the beginning of map_file() as
the call to open(2) will overwrite it anyway.
Also adapt a check for a valid file descriptor. Although POSIX states
that open(2) returns -1 on error, there is no reason to hard-code this
constant. Instead, check for any negative value.