1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Refactor macro SRS_AUTO_XXX to SRS_XXX.

This commit is contained in:
winlin 2020-04-29 20:02:28 +08:00
parent 2fe1874a87
commit ed338f4c0a
31 changed files with 193 additions and 198 deletions

View file

@ -35,7 +35,7 @@
#include <sys/time.h>
#include <math.h>
#include <map>
#ifdef SRS_AUTO_OSX
#ifdef SRS_OSX
#include <sys/sysctl.h>
#endif
using namespace std;
@ -329,7 +329,7 @@ SrsProcSystemStat* srs_get_system_proc_stat()
bool get_proc_system_stat(SrsProcSystemStat& r)
{
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
FILE* f = fopen("/proc/stat", "r");
if (f == NULL) {
srs_warn("open system cpu stat failed, ignore");
@ -368,7 +368,7 @@ bool get_proc_system_stat(SrsProcSystemStat& r)
bool get_proc_self_stat(SrsProcSelfStat& r)
{
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
FILE* f = fopen("/proc/self/stat", "r");
if (f == NULL) {
srs_warn("open self cpu stat failed, ignore");
@ -491,7 +491,7 @@ SrsDiskStat* srs_get_disk_stat()
bool srs_get_disk_vmstat_stat(SrsDiskStat& r)
{
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
FILE* f = fopen("/proc/vmstat", "r");
if (f == NULL) {
srs_warn("open vmstat failed, ignore");
@ -523,7 +523,7 @@ bool srs_get_disk_diskstats_stat(SrsDiskStat& r)
r.ok = true;
r.sample_time = srsu2ms(srs_get_system_time());
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
// if disabled, ignore all devices.
SrsConfDirective* conf = _srs_config->get_stats_disk_device();
if (conf == NULL) {
@ -687,7 +687,7 @@ void srs_update_meminfo()
{
SrsMemInfo& r = _srs_system_meminfo;
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
FILE* f = fopen("/proc/meminfo", "r");
if (f == NULL) {
srs_warn("open meminfo failed, ignore");
@ -781,7 +781,7 @@ void srs_update_platform_info()
r.srs_startup_time = srsu2ms(srs_get_system_startup_time());
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
if (true) {
FILE* f = fopen("/proc/uptime", "r");
if (f == NULL) {
@ -893,7 +893,7 @@ int srs_get_network_devices_count()
void srs_update_network_devices()
{
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
if (true) {
FILE* f = fopen("/proc/net/dev", "r");
if (f == NULL) {
@ -978,7 +978,7 @@ void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps)
int nb_tcp_mem = 0;
int nb_udp4 = 0;
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
if (true) {
FILE* f = fopen("/proc/net/sockstat", "r");
if (f == NULL) {
@ -1021,7 +1021,7 @@ void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps)
int nb_tcp_estab = 0;
#ifndef SRS_AUTO_OSX
#ifndef SRS_OSX
if (true) {
FILE* f = fopen("/proc/net/snmp", "r");
if (f == NULL) {