diff options
-rw-r--r-- | usr/src/cmd/svr4pkg/hdrs/libinst.h | 52 | ||||
-rw-r--r-- | usr/src/cmd/svr4pkg/libinst/mntinfo.c | 88 | ||||
-rw-r--r-- | usr/src/lib/libpkg/common/cfext.h | 4 |
3 files changed, 73 insertions, 71 deletions
diff --git a/usr/src/cmd/svr4pkg/hdrs/libinst.h b/usr/src/cmd/svr4pkg/hdrs/libinst.h index 38d16018ad..2d87d8e9ff 100644 --- a/usr/src/cmd/svr4pkg/hdrs/libinst.h +++ b/usr/src/cmd/svr4pkg/hdrs/libinst.h @@ -210,8 +210,8 @@ extern int eval_path __P((char **server_ptr, char **client_ptr, char **map_ptr, char *path)); extern int get_orig_offset __P((void)); extern char *get_inst_root __P((void)); -extern char *get_mount_point __P((short n)); -extern char *get_remote_path __P((short n)); +extern char *get_mount_point __P((uint32_t n)); +extern char *get_remote_path __P((uint32_t n)); extern void set_env_cbdir __P((void)); extern int set_inst_root __P((char *path)); extern void put_path_params __P((void)); @@ -242,32 +242,32 @@ extern int isUpdate __P((void)); /* mntinfo.c */ extern int get_mntinfo __P((int map_client, char *vfstab_file)); -extern short fsys __P((char *path)); -extern struct fstable *get_fs_entry __P((short n)); +extern uint32_t fsys __P((char *path)); +extern struct fstable *get_fs_entry __P((uint32_t n)); extern int mount_client __P((void)); extern int unmount_client __P((void)); -extern short resolved_fsys __P((char *path)); -extern char *get_server_host __P((short n)); -extern char *server_map __P((char *path, short fsys_value)); -extern int use_srvr_map __P((char *path, short *fsys_value)); -extern int use_srvr_map_n __P((short n)); -extern int is_fs_writeable __P((char *path, short *fsys_value)); -extern int is_remote_fs __P((char *path, short *fsys_value)); -extern int is_served __P((char *path, short *fsys_value)); -extern int is_mounted __P((char *path, short *fsys_value)); -extern int is_fs_writeable_n __P((short n)); -extern int is_remote_fs_n __P((short n)); -extern int is_served_n __P((short n)); -extern int is_mounted_n __P((short n)); -extern fsblkcnt_t get_blk_size_n __P((short n)); -extern fsblkcnt_t get_frag_size_n __P((short n)); -extern fsblkcnt_t get_blk_used_n __P((short n)); -extern fsblkcnt_t get_blk_free_n __P((short n)); -extern fsblkcnt_t get_inode_used_n __P((short n)); -extern fsblkcnt_t get_inode_free_n __P((short n)); -extern void set_blk_used_n __P((short n, fsblkcnt_t value)); -extern char *get_source_name_n __P((short n)); -extern char *get_fs_name_n __P((short n)); +extern uint32_t resolved_fsys __P((char *path)); +extern char *get_server_host __P((uint32_t n)); +extern char *server_map __P((char *path, uint32_t fsys_value)); +extern int use_srvr_map __P((char *path, uint32_t *fsys_value)); +extern int use_srvr_map_n __P((uint32_t n)); +extern int is_fs_writeable __P((char *path, uint32_t *fsys_value)); +extern int is_remote_fs __P((char *path, uint32_t *fsys_value)); +extern int is_served __P((char *path, uint32_t *fsys_value)); +extern int is_mounted __P((char *path, uint32_t *fsys_value)); +extern int is_fs_writeable_n __P((uint32_t n)); +extern int is_remote_fs_n __P((uint32_t n)); +extern int is_served_n __P((uint32_t n)); +extern int is_mounted_n __P((uint32_t n)); +extern fsblkcnt_t get_blk_size_n __P((uint32_t n)); +extern fsblkcnt_t get_frag_size_n __P((uint32_t n)); +extern fsblkcnt_t get_blk_used_n __P((uint32_t n)); +extern fsblkcnt_t get_blk_free_n __P((uint32_t n)); +extern fsblkcnt_t get_inode_used_n __P((uint32_t n)); +extern fsblkcnt_t get_inode_free_n __P((uint32_t n)); +extern void set_blk_used_n __P((uint32_t n, fsblkcnt_t value)); +extern char *get_source_name_n __P((uint32_t n)); +extern char *get_fs_name_n __P((uint32_t n)); extern int load_fsentry __P((struct fstable *fs_entry, char *name, char *fstype, char *remote_name)); extern int isreloc __P((char *pkginstdir)); diff --git a/usr/src/cmd/svr4pkg/libinst/mntinfo.c b/usr/src/cmd/svr4pkg/libinst/mntinfo.c index 45a21362e6..67bba5165a 100644 --- a/usr/src/cmd/svr4pkg/libinst/mntinfo.c +++ b/usr/src/cmd/svr4pkg/libinst/mntinfo.c @@ -216,7 +216,7 @@ really_write(char *mountpt) /* This returns the hostname portion of a remote path. */ char * -get_server_host(short n) +get_server_host(uint32_t n) { static char hostname[HOST_NM_LN], *host_end; @@ -224,7 +224,7 @@ get_server_host(short n) return ("unknown source"); } - if (n >= 0 && n < fs_tab_used) { + if (n < fs_tab_used) { (void) strcpy(hostname, fs_tab[n]->remote_name); if ((host_end = strchr(hostname, ':')) == NULL) { if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTO)) == NULL) @@ -375,8 +375,8 @@ unmount_client() if (pid_return != pid) { logerr(WRN_BAD_WAIT, pid, pid_return, - (unsigned long)status, errno, - strerror(errno)); + (unsigned long)status, errno, + strerror(errno)); retcode = 0; } @@ -390,7 +390,7 @@ unmount_client() (errcode = WEXITSTATUS(status))) { retcode = 0; logerr(WRN_FSTAB_UMOUNT, - fs_tab[n]->name, errcode); + fs_tab[n]->name, errcode); } else { fs_tab[n]->cl_mounted = 0; } @@ -502,8 +502,8 @@ mount_client() if (pid_return != pid) { logerr(WRN_BAD_WAIT, pid, pid_return, - (unsigned long)status, errno, - strerror(errno)); + (unsigned long)status, errno, + strerror(errno)); retcode = 0; } @@ -566,17 +566,17 @@ mount_client() * for further processing, it should be strdup()'d or something. */ char * -server_map(char *path, short fsys_value) +server_map(char *path, uint32_t fsys_value) { static char server_construction[PATH_MAX]; if (fs_tab_used == 0) { (void) strcpy(server_construction, path); - } else if (fsys_value >= 0 && fsys_value < fs_tab_used) { + } else if (fsys_value < fs_tab_used) { (void) snprintf(server_construction, - sizeof (server_construction), - "%s%s", fs_tab[fsys_value]->remote_name, - path+strlen(fs_tab[fsys_value]->name)); + sizeof (server_construction), + "%s%s", fs_tab[fsys_value]->remote_name, + path+strlen(fs_tab[fsys_value]->name)); } else { (void) strcpy(server_construction, path); } @@ -912,10 +912,10 @@ get_mntinfo(int map_client, char *vfstab_file) */ if (vfstab_file) { (void) snprintf(VFS_TABLE, sizeof (VFS_TABLE), "%s", - vfstab_file); + vfstab_file); } else { (void) snprintf(VFS_TABLE, sizeof (VFS_TABLE), "%s%s", - install_root, VFSTAB); + install_root, VFSTAB); } if (access(VFS_TABLE, R_OK) == 0) { @@ -926,7 +926,7 @@ get_mntinfo(int map_client, char *vfstab_file) */ if ((pp = setmntent(VFS_TABLE, "r")) == NULL) { progerr(ERR_NOTABLE, "vfs", VFS_TABLE, - strerror(errno)); + strerror(errno)); return (1); } @@ -956,8 +956,8 @@ get_mntinfo(int map_client, char *vfstab_file) install_root); } else { (void) snprintf(client_mountp, - sizeof (client_mountp), "%s%s", - install_root, vfs->vfs_mountp); + sizeof (client_mountp), "%s%s", + install_root, vfs->vfs_mountp); } /* @@ -983,8 +983,9 @@ get_mntinfo(int map_client, char *vfstab_file) is_remote); } else { /* MNT_NOT */ if (construct_vfs(vfs, client_mountp, - link_name, is_remote, mnt_stat)) + link_name, is_remote, mnt_stat)) { return (1); + } } } (void) endmntent(pp); @@ -1051,7 +1052,7 @@ load_fsentry(struct fstable *fs_entry, char *name, char *fstype, * refer to other filesystems. It just returns the entry containing this * path. */ -short +uint32_t fsys(char *path) { register int i; @@ -1128,8 +1129,9 @@ fsys(char *path) */ if ((fs_namelen == 1 && *(fs_tab[i]->name) == '/') || ((term_char == '/' || term_char == NULL) && - strncmp(fs_tab[i]->name, path2use, fs_namelen) == 0)) + strncmp(fs_tab[i]->name, path2use, fs_namelen) == 0)) { return (i); + } } /* @@ -1147,7 +1149,7 @@ fsys(char *path) * it will return the filesystem that the loopback filesystem is mounted * over. */ -short +uint32_t resolved_fsys(char *path) { int i = -1; @@ -1170,7 +1172,7 @@ resolved_fsys(char *path) * install root is really the target filesystem. */ int -use_srvr_map_n(short n) +use_srvr_map_n(uint32_t n) { return ((int)fs_tab[n]->srvr_map); } @@ -1181,7 +1183,7 @@ use_srvr_map_n(short n) * to this file system. */ int -is_mounted_n(short n) +is_mounted_n(uint32_t n) { return ((int)fs_tab[n]->mounted); } @@ -1191,7 +1193,7 @@ is_mounted_n(short n) * if it's writeable, 0 if read-only. */ int -is_fs_writeable_n(short n) +is_fs_writeable_n(uint32_t n) { /* * If the write access permissions haven't been confirmed, do that @@ -1217,14 +1219,14 @@ is_fs_writeable_n(short n) * Note: Upon entry, a valid fsys() is required. */ int -is_remote_fs_n(short n) +is_remote_fs_n(uint32_t n) { return ((int)fs_tab[n]->remote); } /* index-driven is_served() */ int -is_served_n(short n) +is_served_n(uint32_t n) { return ((int)fs_tab[n]->served); } @@ -1235,7 +1237,7 @@ is_served_n(short n) * Note: Upon entry, a valid fsys() is required. */ fsblkcnt_t -get_blk_free_n(short n) +get_blk_free_n(uint32_t n) { return (fs_tab[n]->bfree); } @@ -1246,7 +1248,7 @@ get_blk_free_n(short n) * Note: Upon entry, a valid fsys() is required. */ fsblkcnt_t -get_blk_used_n(short n) +get_blk_used_n(uint32_t n) { return (fs_tab[n]->bused); } @@ -1257,7 +1259,7 @@ get_blk_used_n(short n) * Note: Upon entry, a valid fsys() is required. */ fsblkcnt_t -get_inode_free_n(short n) +get_inode_free_n(uint32_t n) { return (fs_tab[n]->ffree); } @@ -1268,7 +1270,7 @@ get_inode_free_n(short n) * Note: Upon entry, a valid fsys() is required. */ fsblkcnt_t -get_inode_used_n(short n) +get_inode_used_n(uint32_t n) { return (fs_tab[n]->fused); } @@ -1279,21 +1281,21 @@ get_inode_used_n(short n) * Note: Upon entry, a valid fsys() is required. */ void -set_blk_used_n(short n, fsblkcnt_t value) +set_blk_used_n(uint32_t n, fsblkcnt_t value) { fs_tab[n]->bused = value; } /* Get the filesystem block size. */ fsblkcnt_t -get_blk_size_n(short n) +get_blk_size_n(uint32_t n) { return (fs_tab[n]->bsize); } /* Get the filesystem fragment size. */ fsblkcnt_t -get_frag_size_n(short n) +get_frag_size_n(uint32_t n) { return (fs_tab[n]->bsize); } @@ -1302,7 +1304,7 @@ get_frag_size_n(short n) * This returns the name of the indicated filesystem. */ char * -get_fs_name_n(short n) +get_fs_name_n(uint32_t n) { if (fs_tab_used == 0) { return (NULL); @@ -1319,7 +1321,7 @@ get_fs_name_n(short n) * Note: Upon entry, a valid fsys() is required. */ char * -get_source_name_n(short n) +get_source_name_n(uint32_t n) { return (fs_tab[n]->remote_name); } @@ -1328,7 +1330,7 @@ get_source_name_n(short n) * This function returns the srvr_map status based upon the path. */ int -use_srvr_map(char *path, short *fsys_value) +use_srvr_map(char *path, uint32_t *fsys_value) { if (*fsys_value == BADFSYS) *fsys_value = fsys(path); @@ -1340,7 +1342,7 @@ use_srvr_map(char *path, short *fsys_value) * This function returns the mount status based upon the path. */ int -is_mounted(char *path, short *fsys_value) +is_mounted(char *path, uint32_t *fsys_value) { if (*fsys_value == BADFSYS) *fsys_value = fsys(path); @@ -1356,7 +1358,7 @@ is_mounted(char *path, short *fsys_value) * an interface requirement. */ int -is_fs_writeable(char *path, short *fsys_value) +is_fs_writeable(char *path, uint32_t *fsys_value) { if (*fsys_value == BADFSYS) *fsys_value = fsys(path); @@ -1372,7 +1374,7 @@ is_fs_writeable(char *path, short *fsys_value) * an interface requirement. */ int -is_remote_fs(char *path, short *fsys_value) +is_remote_fs(char *path, uint32_t *fsys_value) { if (*fsys_value == BADFSYS) *fsys_value = fsys(path); @@ -1387,7 +1389,7 @@ is_remote_fs(char *path, short *fsys_value) * (eg: pkgadd or pkgrm) will be writing to it. */ int -is_served(char *path, short *fsys_value) +is_served(char *path, uint32_t *fsys_value) { if (*fsys_value == BADFSYS) *fsys_value = fsys(path); @@ -1401,7 +1403,7 @@ is_served(char *path, short *fsys_value) * return NULL if it's a local filesystem. */ char * -get_remote_path(short n) +get_remote_path(uint32_t n) { char *p; @@ -1421,7 +1423,7 @@ get_remote_path(short n) * return NULL if it's a local filesystem. */ char * -get_mount_point(short n) +get_mount_point(uint32_t n) { if (!is_remote_fs_n(n)) return (NULL); /* local */ @@ -1429,7 +1431,7 @@ get_mount_point(short n) } struct fstable * -get_fs_entry(short n) +get_fs_entry(uint32_t n) { if (fs_tab_used == 0) { return (NULL); diff --git a/usr/src/lib/libpkg/common/cfext.h b/usr/src/lib/libpkg/common/cfext.h index 14ec1fce2a..450e2a8d0d 100644 --- a/usr/src/lib/libpkg/common/cfext.h +++ b/usr/src/lib/libpkg/common/cfext.h @@ -67,8 +67,8 @@ struct mergstat { struct cfextra { struct cfent cf_ent; /* basic contents file entry */ struct mergstat mstat; /* merge status for installs */ - short fsys_value; /* fstab[] entry index */ - short fsys_base; /* actual base filesystem in fs_tab[] */ + uint32_t fsys_value; /* fstab[] entry index */ + uint32_t fsys_base; /* actual base filesystem in fs_tab[] */ char *client_path; /* the client-relative path */ char *server_path; /* the server-relative path */ char *map_path; /* as read from the pkgmap */ |