pike.git / src / modules / _Stdio / efuns.c

version» Context lines:

pike.git/src/modules/_Stdio/efuns.c:764:   #endif /* HAVE_USTAT */   #endif /* HAVE_STATFS */   #endif /* HAVE_STATVFS */    THREADS_DISALLOW();    pop_n_elems(args);    if(i==-1)    {    push_int(0);    }else{    int num_fields = 0; -  char *fsname = NULL; +    #ifdef HAVE_STATVFS   #if 0    push_text("id"); push_int(st.f_fsid);    num_fields++;   #endif    push_text("blocksize"); push_int(st.f_frsize);    push_text("blocks"); push_int(st.f_blocks);    push_text("bfree"); push_int(st.f_bfree);    push_text("bavail"); push_int(st.f_bavail);    push_text("files"); push_int(st.f_files);    push_text("ffree"); push_int(st.f_ffree);    push_text("favail"); push_int(st.f_favail);    num_fields += 7;   #ifdef HAVE_STATVFS_F_FSTR -  push_text("fsname"); push_text(fsname = st.f_fstr); +  push_text("fsname"); push_text(st.f_fstr);    num_fields++;   #endif /* HAVE_STATVFS_F_FSTR */   #ifdef HAVE_STATVFS_F_BASETYPE    push_text("fstype"); push_text(st.f_basetype);    num_fields++;   #endif /* HAVE_STATVFS_F_BASETYPE */   #else /* !HAVE_STATVFS */   #ifdef HAVE_STATFS   #ifdef HAVE_STRUCT_STATFS   #if 0 && HAVE_STATFS_F_FSID
pike.git/src/modules/_Stdio/efuns.c:821: Inside #if defined(HAVE_STATFS)
   num_fields += 4;   #else /* !HAVE_STRUCT_FS_DATA */    /* Should not be reached */   #error No struct to hold statfs() data.   #endif /* HAVE_STRUCT_FS_DATA */   #endif /* HAVE_STRUCT_STATFS */   #else /* !HAVE_STATFS */   #ifdef HAVE_USTAT    push_text("bfree"); push_int(st.f_tfree);    push_text("ffree"); push_int(st.f_tinode); -  push_text("fsname"); push_text(fsname = st.f_fname); +  push_text("fsname"); push_text(st.f_fname);    num_fields += 3;   #else    /* Should not be reached */   #error No stat function for filesystems.   #endif /* HAVE_USTAT */   #endif /* HAVE_STATFS */   #endif /* HAVE_STATVFS */ - #if 0 - #if defined(HAVE_LIBZFS_INIT) && defined(HAVE_ZFS_PATH_TO_ZHANDLE) -  /* zfs_path_to_zhandle() has an unfortunate tendency to output stuff -  * to stderr when it fails... -  */ -  if (fsname && !strcmp(fsname, "zfs")) { -  zfs_handle_t *zfs_handle; -  if ((str->len == 1) && (str->str[0] == '.')) { -  /* Workaround for bug in zfs_path_to_zhandle(). */ -  zfs_handle = zfs_path_to_zhandle(libzfs_handle, "./", -  ZFS_TYPE_FILESYSTEM); -  } else { -  zfs_handle = zfs_path_to_zhandle(libzfs_handle, str->str, -  ZFS_TYPE_FILESYSTEM); -  } -  if (zfs_handle) { - #ifndef HAVE_ZFS_PROP_UTF8ONLY -  /* NOTE: ZFS_PROP_UTF8ONLY is not present in Solaris 10 127112-05. -  * Attempt to be forward compatible. -  */ - #define ZFS_PROP_UTF8ONLY (ZFS_PROP_XATTR + 4) - #endif /* !HAVE_ZFS_PROP_UTF8ONLY */ -  if (zfs_prop_get_int(zfs_handle, ZFS_PROP_UTF8ONLY)) { -  push_text("filename_encoding"); -  push_text("utf8"); -  num_fields++; -  } -  } -  } - #endif /* HAVE_LIBZFS_INIT && HAVE_ZFS_PATH_TO_ZHANDLE */ - #endif /* 0 */ -  +     f_aggregate_mapping(num_fields*2);    }   }      #endif /* HAVE_STATVFS || HAVE_STATFS || HAVE_USTAT */   #endif /* __NT__ */      /*! @decl int rm(string f)    *!    *! Remove a file or directory.