aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/librc/librc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c
index a6ff0fe6..98765d84 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -767,19 +767,15 @@ librc_hidden_def(rc_service_state)
char *
rc_service_value_get(const char *service, const char *option)
{
- FILE *fp;
- char *line = NULL;
+ char *buffer = NULL;
size_t len = 0;
char file[PATH_MAX];
snprintf(file, sizeof(file), RC_SVCDIR "/options/%s/%s",
service, option);
- if ((fp = fopen(file, "r"))) {
- rc_getline(&line, &len, fp);
- fclose(fp);
- }
+ rc_getfile(file, &buffer, &len);
- return line;
+ return buffer;
}
librc_hidden_def(rc_service_value_get)