mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Fix some minor code style issues
This commit is contained in:
parent
6fb73a3d97
commit
f04e67779c
@ -148,17 +148,17 @@ const char* GetThreadName( uint64_t id )
|
|||||||
# elif defined __linux__
|
# elif defined __linux__
|
||||||
int cs, fd;
|
int cs, fd;
|
||||||
char path[32];
|
char path[32];
|
||||||
int tid = (int)syscall( SYS_gettid );
|
int tid = (int) syscall( SYS_gettid );
|
||||||
snprintf( path, sizeof(path), "/proc/self/task/%d/comm", tid );
|
snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid );
|
||||||
sprintf( buf, "%" PRIu64, id );
|
sprintf( buf, "%" PRIu64, id );
|
||||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );
|
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );
|
||||||
if ((fd = open(path, O_RDONLY)) > 0) {
|
if ( ( fd = open( path, O_RDONLY ) ) > 0) {
|
||||||
int len = read( fd, buf, 255 );
|
int len = read( fd, buf, 255 );
|
||||||
if (len > 0)
|
if ( len > 0 )
|
||||||
buf[len] = 0;
|
buf[len] = 0;
|
||||||
close(fd);
|
close( fd );
|
||||||
}
|
}
|
||||||
pthread_setcancelstate(cs, 0);
|
pthread_setcancelstate( cs, 0 );
|
||||||
return buf;
|
return buf;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user