_r functions are deprecated in hpux 11 and not supported on itanium

This commit is contained in:
Doug MacEachern 2006-08-05 00:35:00 +00:00
parent b1a754626c
commit 36fc25dab6
2 changed files with 8 additions and 9 deletions

View File

@ -279,7 +279,7 @@ int sigar_get_iftype(const char *name, int *type, int *inst);
#endif #endif
#define SIGAR_HOSTENT_LEN 512 #define SIGAR_HOSTENT_LEN 512
#if defined(__hpux) || defined(_AIX) #if defined(_AIX)
#define SIGAR_HAS_HOSTENT_DATA #define SIGAR_HAS_HOSTENT_DATA
#endif #endif

View File

@ -495,8 +495,7 @@ int sigar_os_fs_type_get(sigar_file_system_t *fsp)
int sigar_file_system_list_get(sigar_t *sigar, int sigar_file_system_list_get(sigar_t *sigar,
sigar_file_system_list_t *fslist) sigar_file_system_list_t *fslist)
{ {
struct mntent ent; struct mntent *ent;
char buf[1025];
FILE *fp; FILE *fp;
sigar_file_system_t *fsp; sigar_file_system_t *fsp;
@ -507,9 +506,9 @@ int sigar_file_system_list_get(sigar_t *sigar,
sigar_file_system_list_create(fslist); sigar_file_system_list_create(fslist);
while (getmntent_r(fp, &ent, buf, sizeof(buf)) == 0) { while ((ent = getmntent(fp))) {
if ((*(ent.mnt_type) == 's') && if ((*(ent->mnt_type) == 's') &&
strEQ(ent.mnt_type, "swap")) strEQ(ent->mnt_type, "swap"))
{ {
/* /*
* in this case, devname == "...", for * in this case, devname == "...", for
@ -523,9 +522,9 @@ int sigar_file_system_list_get(sigar_t *sigar,
fsp = &fslist->data[fslist->number++]; fsp = &fslist->data[fslist->number++];
SIGAR_SSTRCPY(fsp->dir_name, ent.mnt_dir); SIGAR_SSTRCPY(fsp->dir_name, ent->mnt_dir);
SIGAR_SSTRCPY(fsp->dev_name, ent.mnt_fsname); SIGAR_SSTRCPY(fsp->dev_name, ent->mnt_fsname);
SIGAR_SSTRCPY(fsp->sys_type_name, ent.mnt_type); SIGAR_SSTRCPY(fsp->sys_type_name, ent->mnt_type);
sigar_fs_type_init(fsp); sigar_fs_type_init(fsp);
} }