[LEDE-DEV] [PATCH uci] file: use fsync after renaming temp file

Vittorio G (VittGam) openwrt at vittgam.net
Wed Sep 7 17:21:38 PDT 2016


Hi,

On 07/09/2016 08:11:03 CEST, Rafał Miłecki wrote:
> +		dir_fd = open(dirname(path), O_RDONLY);
> +		if (dir_fd) {

This should be dir_fd != -1, as -1 is returned when an error occurs in open().

> +			fsync(dir_fd);
> +			close(dir_fd);
> +		}

Cheers,
Vittorio



More information about the Lede-dev mailing list