sprintf(input, "/dev/dvb/adapter%d/dvr0", adapter_nr);
start_time = time(NULL);
fin = open(input, (O_RDONLY));
- while ( rt = read(fin, buf, 1316) > 0 ) {
+ while ( ( rt = read(fin, buf, 1316) ) > 0 ) {
shift = 0;
- while ( wt = write(fout, buf + shift, rt) > 0) {
+ while ( ( wt = write(fout, buf + shift, rt) ) > 0) {
rt -= wt;
if ( rt == 0 ) break;
shift += wt;
int rectime;
if (argc <= 2) {
- fprintf(stderr, "Usage: %s adapter_nr freq [tsid]\n", argv[0]);
+ fprintf(stderr, "Usage: %s adapter_nr freq tsid rectime output\n", argv[0]);
return 1;
}
adapter_nr = strtol(argv[1], NULL, 0);
channel_freq = strtol(argv[2], NULL, 10);
- channel_id = rectime = 0;
- if ( argc >= 4 ){
- channel_id = strtol(argv[3], NULL, 10);
- }
- if ( argc >= 5 ) {
- rectime = atoi(argv[4]);
- }
+ channel_id = strtol(argv[3], NULL, 10);
+ rectime = atoi(argv[4]);
fd = search(adapter_nr, channel_freq, channel_id);
if (fd < 0)
return 1;