Fix some minor code style issues

This commit is contained in:
Arvid Gerstmann 2018-07-14 13:46:25 +02:00
parent 6fb73a3d97
commit f04e67779c

View File

@ -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