mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
close a fd, and unbreak compilation outside of Android.
This commit is contained in:
parent
bca89e76de
commit
2491f11efc
@ -851,6 +851,7 @@ static bool TrySuCommandFlag(const char* flag) {
|
|||||||
// tries incorrect command lines.
|
// tries incorrect command lines.
|
||||||
int null_fd = open( "/dev/null", O_WRONLY );
|
int null_fd = open( "/dev/null", O_WRONLY );
|
||||||
dup2( null_fd, STDERR_FILENO );
|
dup2( null_fd, STDERR_FILENO );
|
||||||
|
close( null_fd );
|
||||||
execlp( "su", "su", flag, "id", "-u", nullptr );
|
execlp( "su", "su", flag, "id", "-u", nullptr );
|
||||||
exit( EXIT_FAILURE );
|
exit( EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
@ -1052,9 +1053,11 @@ bool SysTraceStart( int64_t& samplingPeriod )
|
|||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
if (GetRootMethod() == RootMethod::None) {
|
if (GetRootMethod() == RootMethod::None) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !TraceWrite( TracingOn, sizeof( TracingOn ), "0", 2 ) ) return false;
|
if( !TraceWrite( TracingOn, sizeof( TracingOn ), "0", 2 ) ) return false;
|
||||||
if( !TraceWrite( CurrentTracer, sizeof( CurrentTracer ), "nop", 4 ) ) return false;
|
if( !TraceWrite( CurrentTracer, sizeof( CurrentTracer ), "nop", 4 ) ) return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user