From d4d363b9b80506c12988fedc1ce2305135f9d213 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Jan 2000 00:50:43 +0900 Subject: close model file properly --- bus.c | 11 ++++++++--- globals.h | 1 + 2 files changed, 9 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; } diff --git a/globals.h b/globals.h index 7ace680..affcd04 100644 --- a/globals.h +++ b/globals.h @@ -827,6 +827,7 @@ typedef struct { bool beaglebone; bool olimex; bool gpib; + char remount_point[32]; } HWDetectStruct; -- cgit