summaryrefslogtreecommitdiff
path: root/bus.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>2000-01-01 00:50:43 +0900
committerroot <root@avtech.domain.avtechpulse.com>2000-01-01 00:50:43 +0900
commitd4d363b9b80506c12988fedc1ce2305135f9d213 (patch)
tree72d7bb17b7151bed00b84aee06a914775c0290f7 /bus.c
parent4553ffb49fada86a35ec0160b42b3f91ecba9ad3 (diff)
close model file properly
Diffstat (limited to 'bus.c')
-rw-r--r--bus.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/bus.c b/bus.c
index e07efee..0c13161 100644
--- a/bus.c
+++ b/bus.c
@@ -64,18 +64,23 @@ static bool util_model_is (char *check_model)
{
FILE *fp;
char content[100];
+ bool retval;
+
+ retval = FALSE;
if ((fp=fopen("/sys/firmware/devicetree/base/model", "r"))==NULL) {
- return FALSE;
+ return retval;
}
while(fgets(content, sizeof(content), fp)) {
if(strstr(content,check_model)) {
- return TRUE;
+ retval = TRUE;
}
}
- return FALSE;
+ fclose (fp);
+
+ return retval;
}