Diff

Differences From Artifact [0c5019ef32]:

To Artifact [190e7becb3]:


   341    341   	if (_path[1] == '\0') {
   342    342   		/* Request for the root directory */
   343    343   		pathinfo->type = APPFS_PATHTYPE_DIRECTORY;
   344    344   		sites = appfs_getsites(&sites_count);
   345    345   		pathinfo->typeinfo.dir.childcount = sites_count;
   346    346   
   347    347   		if (children) {
          348  +			*children = NULL;
   348    349   			for (site = sites; site; site = site->_next) {
   349    350   				node = (void *) ckalloc(sizeof(*node));
   350    351   				node->_next = *children;
          352  +				strcpy(node->name, site->name);
   351    353   				*children = node;
   352    354   			}
   353    355   		}
   354    356   
   355    357   		appfs_free_list_site(sites);
   356    358   
   357    359   		return(0);
................................................................................
   401    403   		stbuf->st_size = pathinfo.typeinfo.file.size;
   402    404   	}
   403    405   
   404    406   	return res;
   405    407   }
   406    408   
   407    409   static int appfs_fuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) {
          410  +	struct appfs_pathinfo pathinfo;
          411  +	struct appfs_children *children, *child;
          412  +	int res;
          413  +
   408    414   	APPFS_DEBUG("Enter (path = %s, ...)", path);
          415  +
          416  +	res = appfs_get_path_info(path, &pathinfo, &children);
          417  +	if (res != 0) {
          418  +		return(res);
          419  +	}
   409    420   
   410    421   	filler(buf, ".", NULL, 0);
   411    422   	filler(buf, "..", NULL, 0);
          423  +
          424  +	for (child = children; child; child = child->_next) {
          425  +		filler(buf, child->name, NULL, 0);
          426  +	}
          427  +
          428  +	appfs_free_list_children(children);
   412    429   
   413    430   	return 0;
   414    431   }
   415    432   
   416    433   static int appfs_fuse_open(const char *path, struct fuse_file_info *fi) {
   417    434   	return(-ENOENT);
   418    435   }