diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-02-22 18:34:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-02-22 18:34:29 +0000 |
commit | e483ac2a2c8eab6d5cc915c2f54ab2c27c469821 (patch) | |
tree | 0cdd2d9b3cc4fc62b085fb2f71103a100313448e /src/fs/gnunet-helper-fs-publish.c | |
parent | 3a04f1fdf2882b96608e164babcd34dbcb2ad777 (diff) | |
download | gnunet-e483ac2a2c8eab6d5cc915c2f54ab2c27c469821.tar.gz gnunet-e483ac2a2c8eab6d5cc915c2f54ab2c27c469821.zip |
LRN: two directory patches change the way "is_directory" is evaluated.
Now it must be GNUNET_YES for the execution flow to switch to a branch
where something is considered to be a directory.
The reason for that is that some functions might return GNUNET_SYSERR
when asked whether something is a directory or not. Checking this
value as "!= GNUNET_NO" will produce positive result, even though it's
not a directory.
Diffstat (limited to 'src/fs/gnunet-helper-fs-publish.c')
-rw-r--r-- | src/fs/gnunet-helper-fs-publish.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 94da0ce19..4f7046408 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c | |||
@@ -298,7 +298,7 @@ preprocess_file (const char *filename, | |||
298 | item->filename = GNUNET_strdup (filename); | 298 | item->filename = GNUNET_strdup (filename); |
299 | item->is_directory = (S_ISDIR (sbuf.st_mode)) ? GNUNET_YES : GNUNET_NO; | 299 | item->is_directory = (S_ISDIR (sbuf.st_mode)) ? GNUNET_YES : GNUNET_NO; |
300 | item->file_size = (uint64_t) sbuf.st_size; | 300 | item->file_size = (uint64_t) sbuf.st_size; |
301 | if (item->is_directory) | 301 | if (item->is_directory == GNUNET_YES) |
302 | { | 302 | { |
303 | struct RecursionContext rc; | 303 | struct RecursionContext rc; |
304 | 304 | ||
@@ -334,7 +334,7 @@ extract_files (struct ScanTreeNode *item) | |||
334 | ssize_t size; | 334 | ssize_t size; |
335 | size_t slen; | 335 | size_t slen; |
336 | 336 | ||
337 | if (item->is_directory) | 337 | if (item->is_directory == GNUNET_YES) |
338 | { | 338 | { |
339 | /* for directories, we simply only descent, no extraction, no | 339 | /* for directories, we simply only descent, no extraction, no |
340 | progress reporting */ | 340 | progress reporting */ |