diff --git a/apps/cit.c b/apps/cit.c index 2a3f6e7..6e2dc74 100644 --- a/apps/cit.c +++ b/apps/cit.c @@ -92,6 +92,10 @@ void *get_ts(void *a) return NULL; sprintf(fname, "/dev/dvb/adapter%u/ci%u", adapter, device); fdi = open(fname, O_RDONLY); + if (fdi == -1) { + printf("Failed to open %s for read: %m\n", fname); + return NULL; + } while (1) { memset(buf, 0, 188*rnum); @@ -123,6 +127,10 @@ int send(void) return -1; sprintf(fname, "/dev/dvb/adapter%u/ci%u", adapter, device); fdo=open(fname, O_WRONLY); + if (fdo == -1) { + printf("Failed to open %s to write: %m\n", fname); + exit(2); + } while (1) { for (i=0; i -d\n"); + exit(-1); break; - } } if (optind < argc) { printf("Warning: unused arguments\n"); } + printf("adpter %d, device: %d\n", adapter, device); memset(ts+8, 180, 0x5a); pthread_create(&th, NULL, get_ts, NULL); usleep(10000);