- char *dir = dir_name(name);
- int dirfd = open(dir, O_RDONLY);
- if (dirfd >= 0) {
- if (fsync(dirfd) && errno != EINVAL) {
- VLOG_ERR("%s: fsync failed (%s)", dir, strerror(errno));
- }
- close(dirfd);
- } else {
- VLOG_ERR("%s: open failed (%s)", dir, strerror(errno));
- }
- free(dir);