aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch
blob: b188248fff67287d9d02d9d03201c7e45a3b0ce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From af256680926e166ac21bc0f11172ea6c077a9b55 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 9 Mar 2024 10:40:48 -0800
Subject: [PATCH] Adopt to new gnulib read_file/fread_file signature

It now expects a flag parameter in latest gnulib
see [1]

[1] https://public-inbox.org/bug-gnulib/87tv01c1z2.fsf-ueno@gnu.org/

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/dutil_linux.c  | 4 ++--
 src/dutil_posix.c  | 2 +-
 src/ncftool.c      | 2 +-
 src/ncftransform.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 742153a..eb72eb2 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -1113,7 +1113,7 @@ static void add_link_info(struct netcf *ncf,
 
     xasprintf(&path, "/sys/class/net/%s/operstate", ifname);
     ERR_NOMEM(!path, ncf);
-    state = read_file(path, &length);
+    state = read_file(path, 0, &length);
     if (!state) {
         /* missing operstate is *not* an error. It could be due to an
          * alias interface, which has no entry in /sys/class/net at
@@ -1132,7 +1132,7 @@ static void add_link_info(struct netcf *ncf,
         FREE(path);
         xasprintf(&path, "/sys/class/net/%s/speed", ifname);
         ERR_NOMEM(path == NULL, ncf);
-        speed = read_file(path, &length);
+        speed = read_file(path, 0, &length);
         if (!speed && errno == EINVAL) {
             /* attempts to read $ifname/speed result in EINVAL if the
              * interface is ifconfiged down (which isn't exactly the
diff --git a/src/dutil_posix.c b/src/dutil_posix.c
index 1313514..b9884f0 100644
--- a/src/dutil_posix.c
+++ b/src/dutil_posix.c
@@ -211,7 +211,7 @@ int run_program(struct netcf *ncf, const char *const *argv, char **output)
                        "Failed to create file stream for output while executing '%s': %s",
                        argv_str, errbuf);
 
-    *output = fread_file(outfile, &outlen);
+    *output = fread_file(outfile, 0, &outlen);
     ERR_THROW_STRERROR(*output == NULL, ncf, EEXEC,
                        "Error while reading output from execution of '%s': %s",
                        argv_str, errbuf);
diff --git a/src/ncftool.c b/src/ncftool.c
index f1b5642..c878cb0 100644
--- a/src/ncftool.c
+++ b/src/ncftool.c
@@ -351,7 +351,7 @@ static int cmd_define(const struct command *cmd) {
     struct netcf_if *nif = NULL;
     int result = CMD_RES_ERR;
 
-    xml = read_file(fname, &length);
+    xml = read_file(fname, 0, &length);
     if (xml == NULL) {
         fprintf(stderr, "Failed to read %s\n", fname);
         goto done;
diff --git a/src/ncftransform.c b/src/ncftransform.c
index fbabfc3..4c9a56d 100644
--- a/src/ncftransform.c
+++ b/src/ncftransform.c
@@ -54,7 +54,7 @@ int main(int argc, char **argv) {
     if (argc != 3 || (STRNEQ(argv[1], "get") && STRNEQ(argv[1], "put")))
         die("Usage: ncftransform (put|get) FILE\n");
 
-    in_xml = read_file(argv[2], &length);
+    in_xml = read_file(argv[2], 0, &length);
     if (in_xml == NULL)
         die("Failed to read %s\n", argv[2]);
 
-- 
2.44.0