Changeset 991:caac09dce026 in roaraudio
- Timestamp:
- 12/18/08 20:19:24 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarmon.c
r669 r991 28 28 29 29 void usage (void) { 30 printf("roarmon [OPTIONS]... \n");30 printf("roarmon [OPTIONS]... [FILE]\n"); 31 31 32 32 printf("\nOptions:\n\n"); … … 51 51 int fh; 52 52 int i; 53 int out = -1; 53 54 char buf[BUFSIZE]; 54 55 … … 69 70 usage(); 70 71 return 0; 72 } else if ( out == -1 ) { 73 if ( (out = open(k, O_CREAT|O_TRUNC|O_WRONLY, 0644)) == -1 ) { 74 fprintf(stderr, "Error: can not open file: %s: %s\n", k, strerror(errno)); 75 return 1; 76 } 71 77 } else { 72 78 fprintf(stderr, "Error: unknown argument: %s\n", k); … … 76 82 } 77 83 84 if ( out == -1 ) 85 out = ROAR_STDOUT; 86 78 87 if ( (fh = roar_simple_monitor(rate, channels, bits, codec, server, "roarmon")) == -1 ) { 79 fprintf(stderr, "Error: can not start mon etoring\n");88 fprintf(stderr, "Error: can not start monitoring\n"); 80 89 return 1; 81 90 } 82 91 83 92 while((i = read(fh, buf, BUFSIZE))) 84 if (write( 1, buf, i) != i)93 if (write(out, buf, i) != i) 85 94 break; 86 95
Note: See TracChangeset
for help on using the changeset viewer.