mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-04 07:19: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:
15
src/osmsg.c
15
src/osmsg.c
@@ -30,14 +30,8 @@ static char *id = "$Id: osmsg.c,v 1.2 1999/01/03 02:07:29 sybalsky Exp $ Copyrig
|
|||||||
#ifndef AIX
|
#ifndef AIX
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif /* AIX */
|
#endif /* AIX */
|
||||||
|
#include <sys/statvfs.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifndef AIX
|
|
||||||
#ifndef MACOSX
|
|
||||||
#ifndef FREEBSD
|
|
||||||
#include <sys/vfs.h>
|
|
||||||
#endif /* FREEBSD */
|
|
||||||
#endif /* MACOSX */
|
|
||||||
#endif /* AIX */
|
|
||||||
#endif /* DOS */
|
#endif /* DOS */
|
||||||
|
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
@@ -218,7 +212,6 @@ LispPTR mess_readp() {
|
|||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
int size;
|
int size;
|
||||||
int rval;
|
int rval;
|
||||||
struct statfs fsbuf;
|
|
||||||
|
|
||||||
/* polling pty nd flush os message to log file */
|
/* polling pty nd flush os message to log file */
|
||||||
flush_pty();
|
flush_pty();
|
||||||
@@ -338,7 +331,7 @@ LispPTR flush_pty() {
|
|||||||
int size;
|
int size;
|
||||||
static fd_set rfds;
|
static fd_set rfds;
|
||||||
int rval;
|
int rval;
|
||||||
struct statfs fsbuf;
|
struct statvfs vfsbuf;
|
||||||
|
|
||||||
SETJMP(NIL);
|
SETJMP(NIL);
|
||||||
DBPRINT(("flush_pty() called.\n"));
|
DBPRINT(("flush_pty() called.\n"));
|
||||||
@@ -364,10 +357,10 @@ LispPTR flush_pty() {
|
|||||||
|
|
||||||
/* Check free space to avoid print System Error Mesage
|
/* Check free space to avoid print System Error Mesage
|
||||||
to /dev/console */
|
to /dev/console */
|
||||||
TIMEOUT(rval = statfs("/tmp", &fsbuf));
|
TIMEOUT(rval = statvfs("/tmp", &vfsbuf));
|
||||||
if (rval != 0) return (NIL);
|
if (rval != 0) return (NIL);
|
||||||
|
|
||||||
if (fsbuf.f_bavail <= (long)0) {
|
if (vfsbuf.f_bavail <= (long)0) {
|
||||||
/* No Free Space */
|
/* No Free Space */
|
||||||
error("osmessage error: No free space on file system (/tmp).");
|
error("osmessage error: No free space on file system (/tmp).");
|
||||||
return (NIL);
|
return (NIL);
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ static char *id = "$Id: vmemsave.c,v 1.2 1999/01/03 02:07:45 sybalsky Exp $ Copy
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
@@ -76,8 +75,6 @@ static char *id = "$Id: vmemsave.c,v 1.2 1999/01/03 02:07:45 sybalsky Exp $ Copy
|
|||||||
#define FILECANNOTWRITE S_POSITIVE | 5
|
#define FILECANNOTWRITE S_POSITIVE | 5
|
||||||
#define FILETIMEOUT S_POSITIVE | 6
|
#define FILETIMEOUT S_POSITIVE | 6
|
||||||
|
|
||||||
struct stat DEBUG_stat;
|
|
||||||
|
|
||||||
extern int LispWindowFd;
|
extern int LispWindowFd;
|
||||||
extern struct pixrect *CursorBitMap, *InvisibleCursorBitMap;
|
extern struct pixrect *CursorBitMap, *InvisibleCursorBitMap;
|
||||||
extern struct cursor CurrentCursor, InvisibleCursor;
|
extern struct cursor CurrentCursor, InvisibleCursor;
|
||||||
@@ -327,7 +324,6 @@ LispPTR vmem_save(char *sysout_file_name)
|
|||||||
int vmemsize; /* VMEMSIZE */
|
int vmemsize; /* VMEMSIZE */
|
||||||
register int i;
|
register int i;
|
||||||
char tempname[MAXPATHLEN];
|
char tempname[MAXPATHLEN];
|
||||||
/* * * struct statfs fsbuf; * * */
|
|
||||||
char *cp;
|
char *cp;
|
||||||
register int rval;
|
register int rval;
|
||||||
DLword *bmptr;
|
DLword *bmptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user