synk

synchronize files between hosts
Log | Files | Refs | README | LICENSE

commit e872191ae4694a75d961467620784755eae1d160
parent 40270e60f6416f066c74fede12926f41b43b6070
Author: Willy <willyatmailoodotorg>
Date:   Sat Sep  3 23:57:31 +0200

Don't fail if a file doesn't exists

Diffstat:
synk.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/synk.c b/synk.c @@ -205,14 +205,12 @@ getmetadata(const char *fn) return NULL; } - if ((f = fopen(fn, "r")) == NULL) { - log(LOG_ERROR, "%s: %s\n", fn, strerror(errno));; - return NULL; - } - memset(meta, 0, sizeof(struct metadata_t)); - sha512(f, meta->hash); snprintf(meta->path, PATH_MAX, "%s", fn); + if ((f = fopen(fn, "r")) == NULL) + return meta; + + sha512(f, meta->hash); meta->mtime = gettimestamp(meta->path); fclose(f);