From c6c7af73954503fb951863f30ef563aecddfbdc3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 16 Jul 2006 14:53:48 +0200 Subject: [RELEASE] flxutils-0.1.29 --- flx/input_fs.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'flx/input_fs.c') diff --git a/flx/input_fs.c b/flx/input_fs.c index 042134c..e64f9da 100644 --- a/flx/input_fs.c +++ b/flx/input_fs.c @@ -35,21 +35,25 @@ static t_file_desc *complete_info_from_fs(char *path, t_file_desc *desc) { /* copy stat informations */ memcpy(&desc->stat, &stat, sizeof(stat)); - if (S_ISREG(stat.st_mode) && !desc->md5) /* get md5 checksum */ - desc->md5 = checksum_md5_from_file(path); - else if (S_ISLNK(stat.st_mode) && !desc->link) { - /* get link and md5 associed */ - char temp[BUFFER_LENGTH]; - int l; - - if ((l = readlink(path, temp, BUFFER_LENGTH)) < 0) { - PFERROR("readlink(%s)", path); - } else { - temp[l] = 0; - desc->link = strdup(temp); - desc->md5 = checksum_md5_from_data(temp, l); + if (IS(Diff, DIFF_CHECKSUM)) { + if (S_ISREG(stat.st_mode) && !desc->md5) /* get md5 checksum */ + desc->md5 = checksum_md5_from_file(path); + else if (S_ISLNK(stat.st_mode) && !desc->link) { + /* get link and md5 associed */ + char temp[BUFFER_LENGTH]; + int l; + + if ((l = readlink(path, temp, BUFFER_LENGTH)) < 0) { + PFERROR("readlink(%s)", path); + } else { + temp[l] = 0; + desc->link = strdup(temp); + desc->md5 = checksum_md5_from_data(temp, l); + } } - } + } else + desc->md5 = NULL; + return (desc); } -- cgit v1.2.3