X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fconf.c;fp=src%2Fconf.c;h=bdd2bc9afafca267c042aa51c3547242881780bd;hb=6ed4599a3614859e0f0283a2ff8cd8dbf0de2996;hp=cae7bd1e90de73c44e4db0acc0677acd7705c2ab;hpb=a08cfad84a0558c021097802ad41f5a46b35b46c;p=meshlink-tiny diff --git a/src/conf.c b/src/conf.c index cae7bd1..bdd2bc9 100644 --- a/src/conf.c +++ b/src/conf.c @@ -316,11 +316,13 @@ static bool copytree(const char *src_dir_name, const void *src_key, const char * config_free(&config); - struct utimbuf times; - times.modtime = st.st_mtime; - times.actime = st.st_atime; + const struct timeval times[2] = {{ + st.st_mtime, + st.st_atime, + } + }; - if(utime(dst_filename, ×)) { + if(utimes(dst_filename, times)) { logger(NULL, MESHLINK_ERROR, "Failed to utime `%s': %s", dst_filename, strerror(errno)); meshlink_errno = MESHLINK_ESTORAGE; return false;