_r functions are deprecated in hpux 11 and not supported on itanium
This commit is contained in:
parent
b1a754626c
commit
36fc25dab6
|
@ -279,7 +279,7 @@ int sigar_get_iftype(const char *name, int *type, int *inst);
|
|||
#endif
|
||||
|
||||
#define SIGAR_HOSTENT_LEN 512
|
||||
#if defined(__hpux) || defined(_AIX)
|
||||
#if defined(_AIX)
|
||||
#define SIGAR_HAS_HOSTENT_DATA
|
||||
#endif
|
||||
|
||||
|
|
|
@ -495,8 +495,7 @@ int sigar_os_fs_type_get(sigar_file_system_t *fsp)
|
|||
int sigar_file_system_list_get(sigar_t *sigar,
|
||||
sigar_file_system_list_t *fslist)
|
||||
{
|
||||
struct mntent ent;
|
||||
char buf[1025];
|
||||
struct mntent *ent;
|
||||
|
||||
FILE *fp;
|
||||
sigar_file_system_t *fsp;
|
||||
|
@ -507,9 +506,9 @@ int sigar_file_system_list_get(sigar_t *sigar,
|
|||
|
||||
sigar_file_system_list_create(fslist);
|
||||
|
||||
while (getmntent_r(fp, &ent, buf, sizeof(buf)) == 0) {
|
||||
if ((*(ent.mnt_type) == 's') &&
|
||||
strEQ(ent.mnt_type, "swap"))
|
||||
while ((ent = getmntent(fp))) {
|
||||
if ((*(ent->mnt_type) == 's') &&
|
||||
strEQ(ent->mnt_type, "swap"))
|
||||
{
|
||||
/*
|
||||
* in this case, devname == "...", for
|
||||
|
@ -523,9 +522,9 @@ int sigar_file_system_list_get(sigar_t *sigar,
|
|||
|
||||
fsp = &fslist->data[fslist->number++];
|
||||
|
||||
SIGAR_SSTRCPY(fsp->dir_name, ent.mnt_dir);
|
||||
SIGAR_SSTRCPY(fsp->dev_name, ent.mnt_fsname);
|
||||
SIGAR_SSTRCPY(fsp->sys_type_name, ent.mnt_type);
|
||||
SIGAR_SSTRCPY(fsp->dir_name, ent->mnt_dir);
|
||||
SIGAR_SSTRCPY(fsp->dev_name, ent->mnt_fsname);
|
||||
SIGAR_SSTRCPY(fsp->sys_type_name, ent->mnt_type);
|
||||
sigar_fs_type_init(fsp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue