diff recpt1/recpt1.c @ 89:d74bcf2d255d

do not give up if LNB ioctl failed
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 27 Jan 2010 15:12:50 +0900
parents 59065b569eec
children 2b55985bbb4c
line wrap: on
line diff
--- a/recpt1/recpt1.c	Wed Jan 27 14:36:47 2010 +0900
+++ b/recpt1/recpt1.c	Wed Jan 27 15:12:50 2010 +0900
@@ -655,9 +655,7 @@
         /* power on LNB */
         if(tdata->table->type == CHTYPE_SATELLITE) {
             if(ioctl(tdata->tfd, LNB_ENABLE, tdata->lnb) < 0) {
-                close(tdata->tfd);
                 fprintf(stderr, "Power on LNB failed: %s\n", device);
-                return 1;
             }
         }
 
@@ -688,9 +686,7 @@
                 /* power on LNB */
                 if(tdata->table->type == CHTYPE_SATELLITE) {
                     if(ioctl(tdata->tfd, LNB_ENABLE, tdata->lnb) < 0) {
-                        close(tdata->tfd);
-                        tdata->tfd = -1;
-                        continue;
+                        fprintf(stderr, "Warning: Power on LNB failed: %s\n", tuner[lp]);
                     }
                 }
 
@@ -777,14 +773,16 @@
 int
 close_tuner(thread_data *tdata)
 {
+    int rv = 0;
+
     if(tdata->table->type == CHTYPE_SATELLITE) {
         if(ioctl(tdata->tfd, LNB_DISABLE, 0) < 0) {
-            return 1;
+            rv = 1;
         }
     }
     close(tdata->tfd);
 
-    return 0;
+    return rv;
 }
 
 int