diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/src/ct_util.erl | 4 | ||||
-rw-r--r-- | lib/os_mon/c_src/memsup.c | 2 | ||||
-rw-r--r-- | lib/os_mon/src/disksup.erl | 24 | ||||
-rwxr-xr-x | lib/wx/configure.in | 4 |
4 files changed, 28 insertions, 6 deletions
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index 2e7e731595..02e58d0786 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -940,7 +940,9 @@ ct_make_ref_loop(N) -> From ! {self(),N}, ct_make_ref_loop(N+1) end. - + +abs_name("/") -> + "/"; abs_name(Dir0) -> Abs = filename:absname(Dir0), Dir = case lists:reverse(Abs) of diff --git a/lib/os_mon/c_src/memsup.c b/lib/os_mon/c_src/memsup.c index 3a1a8e9444..8e610f951b 100644 --- a/lib/os_mon/c_src/memsup.c +++ b/lib/os_mon/c_src/memsup.c @@ -104,7 +104,7 @@ #if !defined (__OpenBSD__) && !defined (__NetBSD__) #include <vm/vm_param.h> #endif -#if defined (__FreeBSD__) || defined(__DragonFly__) +#if defined (__FreeBSD__) || defined(__DragonFly__) || defined (__NetBSD__) #include <sys/vmmeter.h> #endif #endif diff --git a/lib/os_mon/src/disksup.erl b/lib/os_mon/src/disksup.erl index f5f76f1488..f906f33d32 100644 --- a/lib/os_mon/src/disksup.erl +++ b/lib/os_mon/src/disksup.erl @@ -275,8 +275,8 @@ check_disk_space({unix, sunos4}, Port, Threshold) -> Result = my_cmd("df", Port), check_disks_solaris(skip_to_eol(Result), Threshold); check_disk_space({unix, darwin}, Port, Threshold) -> - Result = my_cmd("/bin/df -k -t ufs,hfs", Port), - check_disks_solaris(skip_to_eol(Result), Threshold). + Result = my_cmd("/bin/df -i -k -t ufs,hfs", Port), + check_disks_susv3(skip_to_eol(Result), Threshold). % This code works for Linux and FreeBSD as well check_disks_solaris("", _Threshold) -> @@ -298,6 +298,26 @@ check_disks_solaris(Str, Threshold) -> check_disks_solaris(skip_to_eol(Str),Threshold) end. +% Parse per SUSv3 specification, notably recent OS X +check_disks_susv3("", _Threshold) -> + []; +check_disks_susv3("\n", _Threshold) -> + []; +check_disks_susv3(Str, Threshold) -> + case io_lib:fread("~s~d~d~d~d%~d~d~d%~s", Str) of + {ok, [_FS, KB, _Used, _Avail, Cap, _IUsed, _IFree, _ICap, MntOn], RestStr} -> + if + Cap >= Threshold -> + set_alarm({disk_almost_full, MntOn}, []); + true -> + clear_alarm({disk_almost_full, MntOn}) + end, + [{MntOn, KB, Cap} | + check_disks_susv3(RestStr, Threshold)]; + _Other -> + check_disks_susv3(skip_to_eol(Str),Threshold) + end. + %% Irix: like Linux with an extra FS type column and no '%'. check_disks_irix("", _Threshold) -> []; check_disks_irix("\n", _Threshold) -> []; diff --git a/lib/wx/configure.in b/lib/wx/configure.in index 6a0d649ccd..9c55e544a4 100755 --- a/lib/wx/configure.in +++ b/lib/wx/configure.in @@ -71,7 +71,7 @@ WXERL_CAN_BUILD_DRIVER=true LM_WINDOWS_ENVIRONMENT -if test X"$MIXED_CYGWIN_VC" == X"yes" -o X"$MIXED_MSYS_VC" == X"yes"; then +if test X"$MIXED_CYGWIN_VC" = X"yes" -o X"$MIXED_MSYS_VC" = X"yes"; then CFLAGS="-Owx" fi @@ -336,7 +336,7 @@ dnl if test "$cross_compiling" = "yes"; then echo "Cross compilation of the wx driver is not supported yet, wx will NOT be usable" > ./CONF_INFO WXERL_CAN_BUILD_DRIVER=false -elif test X"$MIXED_CYGWIN_VC" == X"no" -a X"$MIXED_MSYS_VC" == X"no"; then +elif test X"$MIXED_CYGWIN_VC" = X"no" -a X"$MIXED_MSYS_VC" = X"no"; then WX_VERSION=`wx-config --version` case $WX_VERSION in 2.8.*) |