aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-07-30 16:09:03 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-07-30 16:09:03 -0300
commitcc713ab7fb620c98b80e2f3f0aef8f01faf35ac3 (patch)
tree2e1f66d3a6ec7ab8a3f265c51612798d16421379
parent2d92e16a4a91d68e88d2678e78296247601ad74f (diff)
keytable: Return an error if setting a protocol fails
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--utils/keytable/keytable.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 7281a29b..7b2f0db2 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -754,7 +754,10 @@ static int v1_get_sw_enabled_protocol(char *dirname)
p = strtok(buf, " \n");
rc = atoi(p);
- fclose(fp);
+ if (fclose(fp)) {
+ perror(name);
+ return errno;
+ }
if (debug)
fprintf(stderr, "protocol %s is %s\n",
@@ -787,7 +790,10 @@ static int v1_set_sw_enabled_protocol(struct rc_device *rc_dev,
else
fprintf(fp, "0");
- fclose(fp);
+ if (fclose(fp)) {
+ perror(name);
+ return errno;
+ }
return 0;
}
@@ -884,7 +890,10 @@ static int v2_set_protocols(struct rc_device *rc_dev)
if (rc_dev->current & OTHER)
fprintf(fp, "+unknown\n");
- fclose(fp);
+ if (fclose(fp)) {
+ perror(name);
+ return errno;
+ }
return 0;
}

Privacy Policy