1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Patch out use of deprecated and now removed ustat(2) function on Linux.

dtfile makes use of ustat(2) on certain systems.  This call has been
deprecated in glibc for a while and now, as of glibc-2.28, it has been
removed.  The recommended replacement is to use statfs(2).
This commit is contained in:
David Cantrell 2018-08-21 15:41:48 -04:00 committed by Jon Trulson
parent fcdeb932d3
commit 9cb1f309f2
2 changed files with 30 additions and 3 deletions

View file

@ -106,8 +106,12 @@
#include <sys/param.h>
#include <sys/mount.h>
#else
#if defined(__linux__)
#include <sys/vfs.h>
#else
#include <ustat.h>
#endif
#endif
#include <Xm/RowColumn.h>
#include <Xm/CascadeB.h>
@ -4264,7 +4268,7 @@ CheckDeletePermissionRecur(
return 0;
}
#if !defined(CSRG_BASED)
#if !defined(CSRG_BASED) && !defined(__linux__)
static int
FileSysType(
int dev)
@ -4274,6 +4278,16 @@ FileSysType(
return -2;
return u1.f_tinode;
}
#else
static int
FileSysType(
int dev)
{
struct statfs u1;
if(statfs(dev,&u1) < 0)
return -2;
return u1.f_ffree;
}
#endif
static int

View file

@ -63,9 +63,12 @@
#include <sys/mount.h>
#include <pwd.h>
#include <fcntl.h>
#if !defined(CSRG_BASED)
#if !defined(CSRG_BASED) && !defined(__linux__)
#include <ustat.h>
#endif
#if defined(__linux__)
#include <sys/vfs.h>
#endif
#include <dirent.h>
@ -358,7 +361,7 @@ ImageInitialize( Display *display )
return ;
} /* end ImageInitialize */
#if !defined(CSRG_BASED)
#if !defined(CSRG_BASED) && !defined(__linux__)
static int
CopyFileSysType(
int dev)
@ -368,6 +371,16 @@ CopyFileSysType(
return -2;
return u1.f_tinode;
}
#else
static int
CopyFileSysType(
int dev)
{
struct statfs u1;
if(statfs(dev,&u1) < 0)
return -2;
return u1.f_ffree;
}
#endif
static int