replace legacy preprocessor tests for linux with POSIX compliant ones

This commit is contained in:
Axel Kohlmeyer
2020-05-03 01:04:52 -04:00
parent d5b9948129
commit fa2a6d7c6b
5 changed files with 9 additions and 9 deletions

View File

@ -306,12 +306,12 @@ double FixHalt::tlimit()
/* ----------------------------------------------------------------------
determine available disk space, if supported. Return -1 if not.
------------------------------------------------------------------------- */
#if defined(__linux) || defined(__APPLE__)
#if defined(__linux__) || defined(__APPLE__)
#include <sys/statvfs.h>
#endif
double FixHalt::diskfree()
{
#if defined(__linux) || defined(__APPLE__)
#if defined(__linux__) || defined(__APPLE__)
struct statvfs fs;
double disk_free = -1.0;
@ -319,7 +319,7 @@ double FixHalt::diskfree()
disk_free = 1.0e100;
int rv = statvfs(dlimit_path,&fs);
if (rv == 0) {
#if defined(__linux)
#if defined(__linux__)
disk_free = fs.f_bavail*fs.f_bsize/1048576.0;
#elif defined(__APPLE__)
disk_free = fs.f_bavail*fs.f_frsize/1048576.0;