diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2015-12-29 22:32:38 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-12-29 22:36:42 +0100 |
commit | 8b87e8c44466f6852c9544c908edef8075757dda (patch) | |
tree | 1aa3190278c4b01ea9bbe2f0e188bfdce0413366 /fatfs/inode.c | |
parent | 2280227bedf69b733a589f12ac6b6d5a4fc36af4 (diff) | |
download | hurd-8b87e8c44466f6852c9544c908edef8075757dda.tar.gz hurd-8b87e8c44466f6852c9544c908edef8075757dda.tar.bz2 hurd-8b87e8c44466f6852c9544c908edef8075757dda.zip |
fix compiler warnings in hurd/isofs
* fatfs/dir.c: Use casts to avoid warnings.
* fatfs/fat.c: Use unsigned char in fat_{from,to}_epoch.
* fatfs/fat.h: Change arguments accordingly.
* fatfs/fat.c (fat_read_sblock): Use size_t instead.
* fatfs/inode.c (diskfs_cached_lookup_in_dirbuf): Remove err variable.
* fatfs/inode.c (diskfs_user_read_node): Don't cast constant.
* fatfs/inode.c (write_node): Check for errors in vm_map.
Diffstat (limited to 'fatfs/inode.c')
-rw-r--r-- | fatfs/inode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fatfs/inode.c b/fatfs/inode.c index 610f3575..4f28d144 100644 --- a/fatfs/inode.c +++ b/fatfs/inode.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ #include <string.h> +#include <error.h> #include "fatfs.h" #include "libdiskfs/fs_S.h" @@ -73,7 +74,6 @@ diskfs_user_make_node (struct node **npp, struct lookup_context *ctx) error_t diskfs_cached_lookup_in_dirbuf (int inum, struct node **npp, vm_address_t buf) { - error_t err; struct lookup_context ctx = { buf: buf, inode: vi_lookup (inum) }; return diskfs_cached_lookup_context (inum, npp, &ctx); } @@ -165,7 +165,7 @@ diskfs_user_read_node (struct node *np, struct lookup_context *ctx) allocated node that has no directory entry yet, only set a minimal amount of data until the dirent is created (and we get called a second time?). */ - if (vk.dir_inode == 0 && vk.dir_offset == (void *) 2) + if (vk.dir_inode == 0 && vk.dir_offset == 2) return 0; if (vk.dir_inode == 0) @@ -363,6 +363,11 @@ write_node (struct node *np) err = vm_map (mach_task_self (), &buf, buflen, 0, 1, memobj, 0, 0, prot, prot, 0); mach_port_deallocate (mach_task_self (), memobj); + if (err) + { + pthread_mutex_unlock (&dp->lock); + error (1, err, "Could not map memory"); + } dr = (struct dirrect *) (buf + vk.dir_offset); |