O_DIRECTORY not supported everywhere, use O_RDONLY.

This commit is contained in:
Roger A. Light 2016-06-27 20:58:25 +01:00
parent 84df2bb923
commit eaef3db142

View File

@ -402,9 +402,9 @@ int mqtt3_db_backup(struct mosquitto_db *db, bool shutdown)
fsync(fileno(db_fptr));
if(db->config->persistence_location){
dir_fd = open(db->config->persistence_location, O_DIRECTORY);
dir_fd = open(db->config->persistence_location, O_RDONLY);
}else{
dir_fd = open(".", O_DIRECTORY);
dir_fd = open(".", O_RDONLY);
}
if(dir_fd > 0){
fsync(dir_fd);