Changeset 2814:40065eb210bc in roaraudio
- Timestamp:
- 09/29/09 18:00:35 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarctl.c
r2739 r2814 200 200 int id[ROAR_CLIENTS_MAX]; 201 201 char tmp[80]; 202 int self_id; 203 struct roar_client self_client; 202 204 struct roar_client c; 203 205 #ifdef _POSIX_USERS … … 206 208 #endif 207 209 210 if ( (self_id = roar_get_clientid(con)) != -1 ) { 211 if ( roar_get_client(con, &self_client, self_id) == -1 ) 212 self_id = -1; 213 } 214 208 215 if ( (num = roar_list_clients(con, id, ROAR_CLIENTS_MAX)) == -1 ) { 209 216 fprintf(stderr, "Error: can not get client list\n"); … … 218 225 } 219 226 printf("Client name : %s\n", c.name); 220 printf("Client PID : %i(%s)\n", c.pid, proc_name(c.pid)); 227 228 if ( roar_nnode_get_socktype(&(c.nnode)) != ROAR_SOCKET_TYPE_UNKNOWN ) { 229 if ( roar_nnode_to_str(&(c.nnode), tmp, 80) == 0 ) { 230 printf("Client network node : %s\n", tmp); 231 } 232 } 233 234 if ( self_id != -1 && roar_nnode_cmp(&(self_client.nnode), &(c.nnode)) == 0 ) { 235 printf("Client PID : %i(%s)\n", c.pid, proc_name(c.pid)); 236 } else { 237 printf("Client PID : %i\n", c.pid); 238 } 221 239 if ( c.uid != -1 ) { 222 240 #ifdef _POSIX_USERS 223 pwd = getpwuid(c.uid); 224 grp = getgrgid(c.gid); 225 printf("Client UID/GID : %i(%s)/%i(%s)\n", c.uid, pwd ? pwd->pw_name : "?", c.gid, grp ? grp->gr_name : "?"); 241 if ( self_id != -1 && roar_nnode_cmp(&(self_client.nnode), &(c.nnode)) == 0 ) { 242 pwd = getpwuid(c.uid); 243 grp = getgrgid(c.gid); 244 printf("Client UID/GID : %i(%s)/%i(%s)\n", c.uid, pwd ? pwd->pw_name : "?", c.gid, grp ? grp->gr_name : "?"); 245 } else { 226 246 #else 227 printf("Client UID/GID : %i/%i\n", c.uid, c.gid);247 if ( 1 ) { 228 248 #endif 249 printf("Client UID/GID : %i/%i\n", c.uid, c.gid); 250 } 229 251 } 230 252 … … 376 398 if ( info.flags & ROAR_FLAG_PASSMIXER ) 377 399 strcat(flags, "passmixer "); 400 if ( info.flags & ROAR_FLAG_PRETHRU ) 401 strcat(flags, "prethru "); 378 402 379 403 printf("Flags : %s\n", flags); … … 759 783 } else if ( !strcmp(c, "virtual") ) { 760 784 f |= ROAR_FLAG_VIRTUAL; 785 } else if ( !strcmp(c, "prethru") ) { 786 f |= ROAR_FLAG_PRETHRU; 761 787 } else { 762 788 fprintf(stderr, "Error: unknown flag: %s\n", c);
Note: See TracChangeset
for help on using the changeset viewer.