diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-02-22 18:34:29 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-02-22 18:34:29 +0000 |
commit | e025fb40aede8f0a6dcff7a56262778caa8d3da8 (patch) | |
tree | 0cdd2d9b3cc4fc62b085fb2f71103a100313448e /src/fs/fs_file_information.c | |
parent | 69931614823251b2e85b5a82828524be28571e30 (diff) |
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.
git-svn-id: https://gnunet.org/svn/gnunet@19949 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/fs/fs_file_information.c')
-rw-r--r-- | src/fs/fs_file_information.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index a633dcb7b1..85a076fee2 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -324,7 +324,7 @@ int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, struct GNUNET_FS_FileInformation *ent) { - if ((ent->dir != NULL) || (ent->next != NULL) || (!dir->is_directory)) + if ((ent->dir != NULL) || (ent->next != NULL) || (dir->is_directory != GNUNET_YES)) { GNUNET_break (0); return GNUNET_SYSERR; @@ -362,12 +362,12 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, no = GNUNET_NO; if (GNUNET_OK != proc (proc_cls, dir, - (dir->is_directory) ? dir->data.dir.dir_size : dir->data. + (dir->is_directory == GNUNET_YES) ? dir->data.dir.dir_size : dir->data. file.file_size, dir->meta, &dir->keywords, &dir->bo, - (dir->is_directory) ? &no : &dir->data.file.do_index, + (dir->is_directory == GNUNET_YES) ? &no : &dir->data.file.do_index, &dir->client_info)) return; - if (!dir->is_directory) + if (dir->is_directory != GNUNET_YES) return; pos = dir->data.dir.entries; while (pos != NULL) @@ -375,9 +375,9 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, no = GNUNET_NO; if (GNUNET_OK != proc (proc_cls, pos, - (pos->is_directory) ? pos->data.dir.dir_size : pos->data. + (pos->is_directory == GNUNET_YES) ? pos->data.dir.dir_size : pos->data. file.file_size, pos->meta, &pos->keywords, &pos->bo, - (pos->is_directory) ? &no : &pos->data.file.do_index, + (pos->is_directory == GNUNET_YES) ? &no : &pos->data.file.do_index, &pos->client_info)) break; pos = pos->next; @@ -404,7 +404,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, int no; no = GNUNET_NO; - if (fi->is_directory) + if (fi->is_directory == GNUNET_YES) { /* clean up directory */ while (NULL != (pos = fi->data.dir.entries)) |