Skip to content

Commit

Permalink
Windows: Disable SRT and stat for cygwin64.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Nov 16, 2022
1 parent 4a4b3d4 commit a0be51b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,16 @@ function apply_auto_options() {
SRS_SRTP_ASM=NO
fi

# TODO: FIXME: Should build address sanitizer for cygwin64.
if [[ $SRS_CYGWIN64 == YES && $SRS_SANITIZER == YES ]]; then
echo "Disable address sanitizer for cygwin64"
SRS_SANITIZER=NO
fi
# TODO: FIXME: Should fix bug for SRT for cygwin64.
if [[ $SRS_CYGWIN64 == YES && $SRS_SRT == YES ]]; then
echo "Disable SRT for cygwin64"
SRS_SRT=NO
fi
}

if [ $help = yes ]; then
Expand Down
20 changes: 10 additions & 10 deletions trunk/src/app/srs_app_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ SrsProcSystemStat* srs_get_system_proc_stat()

bool get_proc_system_stat(SrsProcSystemStat& r)
{
#ifndef SRS_OSX
#if !defined(SRS_OSX)
FILE* f = fopen("/proc/stat", "r");
if (f == NULL) {
srs_warn("open system cpu stat failed, ignore");
Expand Down Expand Up @@ -369,7 +369,7 @@ bool get_proc_system_stat(SrsProcSystemStat& r)

bool get_proc_self_stat(SrsProcSelfStat& r)
{
#ifndef SRS_OSX
#if !defined(SRS_OSX)
FILE* f = fopen("/proc/self/stat", "r");
if (f == NULL) {
srs_warn("open self cpu stat failed, ignore");
Expand Down Expand Up @@ -493,7 +493,7 @@ SrsDiskStat* srs_get_disk_stat()

bool srs_get_disk_vmstat_stat(SrsDiskStat& r)
{
#ifndef SRS_OSX
#if !defined(SRS_OSX) && !defined(SRS_CYGWIN64)
FILE* f = fopen("/proc/vmstat", "r");
if (f == NULL) {
srs_warn("open vmstat failed, ignore");
Expand Down Expand Up @@ -525,7 +525,7 @@ bool srs_get_disk_diskstats_stat(SrsDiskStat& r)
r.ok = true;
r.sample_time = srsu2ms(srs_update_system_time());

#ifndef SRS_OSX
#if !defined(SRS_OSX)
// if disabled, ignore all devices.
SrsConfDirective* conf = _srs_config->get_stats_disk_device();
if (conf == NULL) {
Expand Down Expand Up @@ -689,7 +689,7 @@ void srs_update_meminfo()
{
SrsMemInfo& r = _srs_system_meminfo;

#ifndef SRS_OSX
#if !defined(SRS_OSX)
FILE* f = fopen("/proc/meminfo", "r");
if (f == NULL) {
srs_warn("open meminfo failed, ignore");
Expand Down Expand Up @@ -783,7 +783,7 @@ void srs_update_platform_info()

r.srs_startup_time = srsu2ms(srs_get_system_startup_time());

#ifndef SRS_OSX
#if !defined(SRS_OSX)
if (true) {
FILE* f = fopen("/proc/uptime", "r");
if (f == NULL) {
Expand Down Expand Up @@ -877,7 +877,7 @@ static SrsSnmpUdpStat _srs_snmp_udp_stat;

bool get_udp_snmp_statistic(SrsSnmpUdpStat& r)
{
#ifndef SRS_OSX
#if !defined(SRS_OSX) && !defined(SRS_CYGWIN64)
if (true) {
FILE* f = fopen("/proc/net/snmp", "r");
if (f == NULL) {
Expand Down Expand Up @@ -983,7 +983,7 @@ int srs_get_network_devices_count()

void srs_update_network_devices()
{
#ifndef SRS_OSX
#if !defined(SRS_OSX) && !defined(SRS_CYGWIN64)
if (true) {
FILE* f = fopen("/proc/net/dev", "r");
if (f == NULL) {
Expand Down Expand Up @@ -1071,7 +1071,7 @@ void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps)
int nb_tcp_mem = 0;
int nb_udp4 = 0;

#ifndef SRS_OSX
#if !defined(SRS_OSX) && !defined(SRS_CYGWIN64)
if (true) {
FILE* f = fopen("/proc/net/sockstat", "r");
if (f == NULL) {
Expand Down Expand Up @@ -1119,7 +1119,7 @@ void srs_update_rtmp_server(int nb_conn, SrsKbps* kbps)

int nb_tcp_estab = 0;

#ifndef SRS_OSX
#if !defined(SRS_OSX) && !defined(SRS_CYGWIN64)
if (true) {
FILE* f = fopen("/proc/net/snmp", "r");
if (f == NULL) {
Expand Down

0 comments on commit a0be51b

Please sign in to comment.