# HG changeset patch # User Paul Eggert # Date 1506915353 25200 # Node ID 2082ea15b4e969f9a1db98378abaf4a16c774bd6 # Parent 2aa7c1e2a1e4b04bd81065eea4e4212590438bd1 fsusage: remove SVR2 support SVR2 was obsolete by 1986 and is no longer supported by anybody, and its code was getting in the way of use of this module by Emacs, which has its own ‘read’ function anyway. * lib/fsusage.c: Do not include sys/filsys.h. (get_fs_usage): Remove SVR2-specific code. * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Do not test for sys/filsys.h or set STAT_READ_FILSYS. * modules/fsusage (Depends-on): Do not depend on full-read. diff -r 2aa7c1e2a1e4 -r 2082ea15b4e9 ChangeLog --- a/ChangeLog Sun Oct 01 18:11:44 2017 -0700 +++ b/ChangeLog Sun Oct 01 20:35:53 2017 -0700 @@ -1,5 +1,15 @@ 2017-10-01 Paul Eggert + fsusage: remove SVR2 support + SVR2 was obsolete by 1986 and is no longer supported by anybody, + and its code was getting in the way of use of this module by + Emacs, which has its own ‘read’ function anyway. + * lib/fsusage.c: Do not include sys/filsys.h. + (get_fs_usage): Remove SVR2-specific code. + * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): + Do not test for sys/filsys.h or set STAT_READ_FILSYS. + * modules/fsusage (Depends-on): Do not depend on full-read. + Simplify autoupdate of licenses * config/srclistvars.sh (GNUWWWLICENSES): Move to a more-typical place. diff -r 2aa7c1e2a1e4 -r 2082ea15b4e9 lib/fsusage.c --- a/lib/fsusage.c Sun Oct 01 18:11:44 2017 -0700 +++ b/lib/fsusage.c Sun Oct 01 20:35:53 2017 -0700 @@ -43,9 +43,6 @@ # if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */ # include # endif -# if defined HAVE_SYS_FILSYS_H && !defined _CRAY -# include /* SVR2 */ -# endif # if HAVE_SYS_STATFS_H # include # endif @@ -170,41 +167,6 @@ fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot); fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree); -#elif defined STAT_READ_FILSYS /* SVR2 */ -# ifndef SUPERBOFF -# define SUPERBOFF (SUPERB * 512) -# endif - - struct filsys fsd; - int fd; - - if (! disk) - { - errno = 0; - return -1; - } - - fd = open (disk, O_RDONLY); - if (fd < 0) - return -1; - lseek (fd, (off_t) SUPERBOFF, 0); - if (full_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd) - { - close (fd); - return -1; - } - close (fd); - - fsp->fsu_blocksize = (fsd.s_type == Fs2b ? 1024 : 512); - fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.s_fsize); - fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.s_tfree); - fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree); - fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0; - fsp->fsu_files = (fsd.s_isize == -1 - ? UINTMAX_MAX - : (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1)); - fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.s_tinode); - #elif defined STAT_STATFS3_OSF1 /* OSF/1 */ struct statfs fsd; diff -r 2aa7c1e2a1e4 -r 2082ea15b4e9 m4/fsusage.m4 --- a/m4/fsusage.m4 Sun Oct 01 18:11:44 2017 -0700 +++ b/m4/fsusage.m4 Sun Oct 01 20:35:53 2017 -0700 @@ -1,4 +1,4 @@ -# serial 31 +# serial 32 # Obtaining file system usage information. # Copyright (C) 1997-1998, 2000-2001, 2003-2017 Free Software Foundation, Inc. @@ -295,17 +295,6 @@ fi fi -if test $ac_fsusage_space = no; then - # SVR2 - # (AIX, HP-UX, OSF/1 already handled above.) - AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include - ]])], - [AC_DEFINE([STAT_READ_FILSYS], [1], - [Define if there is no specific function for reading file systems usage - information and you have the header file. (SVR2)]) - ac_fsusage_space=yes]) -fi - AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) ]) @@ -342,6 +331,6 @@ # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], [ - AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h]) + AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/statfs.h]) gl_STATFS_TRUNCATES ]) diff -r 2aa7c1e2a1e4 -r 2082ea15b4e9 modules/fsusage --- a/modules/fsusage Sun Oct 01 18:11:44 2017 -0700 +++ b/modules/fsusage Sun Oct 01 20:35:53 2017 -0700 @@ -10,7 +10,6 @@ largefile stdbool stdint -full-read [test $gl_cv_fs_space = yes] configure.ac: gl_FSUSAGE