From b230ff9d8f1a393c13f338b030cace0899d5ec26 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 30 Dec 2020 00:16:27 +0100 Subject: *: use fopen helpers where appropriate function old new delta finalize 348 343 -5 parse_resolvconf 306 299 -7 list_i2c_busses_and_exit 495 483 -12 bootchartd_main 1091 1076 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-39) Total: -39 bytes Signed-off-by: Denys Vlasenko --- miscutils/i2c_tools.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'miscutils') diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index cda17ee00..48135921d 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c @@ -1149,12 +1149,12 @@ static void NORETURN list_i2c_busses_and_exit(void) /* Simple version for ISA chips. */ snprintf(path, NAME_MAX, "%s/%s/name", i2cdev_path, de->d_name); - fp = fopen(path, "r"); + fp = fopen_for_read(path); if (fp == NULL) { snprintf(path, NAME_MAX, "%s/%s/device/name", i2cdev_path, de->d_name); - fp = fopen(path, "r"); + fp = fopen_for_read(path); } /* Non-ISA chips require the hard-way. */ @@ -1175,7 +1175,7 @@ static void NORETURN list_i2c_busses_and_exit(void) "%s/%s/device/%s/name", i2cdev_path, de->d_name, subde->d_name); - fp = fopen(path, "r"); + fp = fopen_for_read(path); break; } } -- cgit v1.2.3