Skip to content

Commit

Permalink
update lib/config_parser.c
Browse files Browse the repository at this point in the history
  • Loading branch information
megumintyan authored and phillipberndt committed Jun 25, 2024
1 parent 7fdf50f commit 9147ca6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/config_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Part of pqiv
*/

#include <errno.h>
#define _POSIX_C_SOURCE 200809L

#include <stdio.h>
Expand Down Expand Up @@ -65,9 +64,8 @@ void config_parser_parse_file(const char *file_name, config_parser_callback_t ca
char *file_data = NULL;

#ifdef HAS_MMAP
errno = 0;
file_data = mmap(NULL, stat.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if(!errno) {
if(file_data != MAP_FAILED) {
config_parser_parse_data(file_data, stat.st_size, callback);
munmap(file_data, stat.st_size);
close(fd);
Expand Down

0 comments on commit 9147ca6

Please sign in to comment.