aboutsummaryrefslogtreecommitdiff
path: root/flx/input_fs.c
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2006-07-16 14:53:48 +0200
committerWilly Tarreau <willy@wtap.(none)>2006-07-26 11:56:35 +0200
commitc6c7af73954503fb951863f30ef563aecddfbdc3 (patch)
tree186fa424e932612c5ca885559772c535af3ddb83 /flx/input_fs.c
parent[RELEASE] flxutils-0.1.28 (diff)
downloadflxutils-c6c7af73954503fb951863f30ef563aecddfbdc3.tar.xz
[RELEASE] flxutils-0.1.29v0.1.29
Diffstat (limited to 'flx/input_fs.c')
-rw-r--r--flx/input_fs.c32
1 files changed, 18 insertions, 14 deletions
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);
}