1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-25 19:46:21 +00:00

Convert nearly-dead code to using statvfs, not statfs. Remove unused stat buf. (#60)

This code is for non-DOS, non-XWindows, and still used the legacy
statfs API.
This commit is contained in:
Bruce Mitchener
2020-12-15 13:24:32 +07:00
committed by GitHub
parent cbcb544e02
commit f6ab28d273
2 changed files with 4 additions and 15 deletions

View File

@@ -30,14 +30,8 @@ static char *id = "$Id: osmsg.c,v 1.2 1999/01/03 02:07:29 sybalsky Exp $ Copyrig
#ifndef AIX
#include <sys/ioctl.h>
#endif /* AIX */
#include <sys/statvfs.h>
#include <sys/time.h>
#ifndef AIX
#ifndef MACOSX
#ifndef FREEBSD
#include <sys/vfs.h>
#endif /* FREEBSD */
#endif /* MACOSX */
#endif /* AIX */
#endif /* DOS */
#include <setjmp.h>
@@ -218,7 +212,6 @@ LispPTR mess_readp() {
struct stat sbuf;
int size;
int rval;
struct statfs fsbuf;
/* polling pty nd flush os message to log file */
flush_pty();
@@ -338,7 +331,7 @@ LispPTR flush_pty() {
int size;
static fd_set rfds;
int rval;
struct statfs fsbuf;
struct statvfs vfsbuf;
SETJMP(NIL);
DBPRINT(("flush_pty() called.\n"));
@@ -364,10 +357,10 @@ LispPTR flush_pty() {
/* Check free space to avoid print System Error Mesage
to /dev/console */
TIMEOUT(rval = statfs("/tmp", &fsbuf));
TIMEOUT(rval = statvfs("/tmp", &vfsbuf));
if (rval != 0) return (NIL);
if (fsbuf.f_bavail <= (long)0) {
if (vfsbuf.f_bavail <= (long)0) {
/* No Free Space */
error("osmessage error: No free space on file system (/tmp).");
return (NIL);