diff options
| author | Khem Raj <raj.khem@gmail.com> | 2024-03-09 10:54:08 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-03-09 10:55:22 -0800 |
| commit | 978395023dc9e6b779d48211278675e2b7972ec7 (patch) | |
| tree | 3cbae14b1a103409c050ab2e6fc2d327077bb683 /meta-networking | |
| parent | 55a6d96e6ae33dc30828f2c5b84d573d13729e2f (diff) | |
| download | meta-openembedded-978395023dc9e6b779d48211278675e2b7972ec7.tar.gz | |
netcf: Fix build with latest gnulib
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
| -rw-r--r-- | meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch | 83 | ||||
| -rw-r--r-- | meta-networking/recipes-support/netcf/netcf_0.2.8.bb | 2 |
2 files changed, 84 insertions, 1 deletions
diff --git a/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch b/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch new file mode 100644 index 0000000000..b188248fff --- /dev/null +++ b/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | From af256680926e166ac21bc0f11172ea6c077a9b55 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 9 Mar 2024 10:40:48 -0800 | ||
| 4 | Subject: [PATCH] Adopt to new gnulib read_file/fread_file signature | ||
| 5 | |||
| 6 | It now expects a flag parameter in latest gnulib | ||
| 7 | see [1] | ||
| 8 | |||
| 9 | [1] https://public-inbox.org/bug-gnulib/87tv01c1z2.fsf-ueno@gnu.org/ | ||
| 10 | |||
| 11 | Upstream-Status: Pending | ||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | src/dutil_linux.c | 4 ++-- | ||
| 15 | src/dutil_posix.c | 2 +- | ||
| 16 | src/ncftool.c | 2 +- | ||
| 17 | src/ncftransform.c | 2 +- | ||
| 18 | 4 files changed, 5 insertions(+), 5 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/src/dutil_linux.c b/src/dutil_linux.c | ||
| 21 | index 742153a..eb72eb2 100644 | ||
| 22 | --- a/src/dutil_linux.c | ||
| 23 | +++ b/src/dutil_linux.c | ||
| 24 | @@ -1113,7 +1113,7 @@ static void add_link_info(struct netcf *ncf, | ||
| 25 | |||
| 26 | xasprintf(&path, "/sys/class/net/%s/operstate", ifname); | ||
| 27 | ERR_NOMEM(!path, ncf); | ||
| 28 | - state = read_file(path, &length); | ||
| 29 | + state = read_file(path, 0, &length); | ||
| 30 | if (!state) { | ||
| 31 | /* missing operstate is *not* an error. It could be due to an | ||
| 32 | * alias interface, which has no entry in /sys/class/net at | ||
| 33 | @@ -1132,7 +1132,7 @@ static void add_link_info(struct netcf *ncf, | ||
| 34 | FREE(path); | ||
| 35 | xasprintf(&path, "/sys/class/net/%s/speed", ifname); | ||
| 36 | ERR_NOMEM(path == NULL, ncf); | ||
| 37 | - speed = read_file(path, &length); | ||
| 38 | + speed = read_file(path, 0, &length); | ||
| 39 | if (!speed && errno == EINVAL) { | ||
| 40 | /* attempts to read $ifname/speed result in EINVAL if the | ||
| 41 | * interface is ifconfiged down (which isn't exactly the | ||
| 42 | diff --git a/src/dutil_posix.c b/src/dutil_posix.c | ||
| 43 | index 1313514..b9884f0 100644 | ||
| 44 | --- a/src/dutil_posix.c | ||
| 45 | +++ b/src/dutil_posix.c | ||
| 46 | @@ -211,7 +211,7 @@ int run_program(struct netcf *ncf, const char *const *argv, char **output) | ||
| 47 | "Failed to create file stream for output while executing '%s': %s", | ||
| 48 | argv_str, errbuf); | ||
| 49 | |||
| 50 | - *output = fread_file(outfile, &outlen); | ||
| 51 | + *output = fread_file(outfile, 0, &outlen); | ||
| 52 | ERR_THROW_STRERROR(*output == NULL, ncf, EEXEC, | ||
| 53 | "Error while reading output from execution of '%s': %s", | ||
| 54 | argv_str, errbuf); | ||
| 55 | diff --git a/src/ncftool.c b/src/ncftool.c | ||
| 56 | index f1b5642..c878cb0 100644 | ||
| 57 | --- a/src/ncftool.c | ||
| 58 | +++ b/src/ncftool.c | ||
| 59 | @@ -351,7 +351,7 @@ static int cmd_define(const struct command *cmd) { | ||
| 60 | struct netcf_if *nif = NULL; | ||
| 61 | int result = CMD_RES_ERR; | ||
| 62 | |||
| 63 | - xml = read_file(fname, &length); | ||
| 64 | + xml = read_file(fname, 0, &length); | ||
| 65 | if (xml == NULL) { | ||
| 66 | fprintf(stderr, "Failed to read %s\n", fname); | ||
| 67 | goto done; | ||
| 68 | diff --git a/src/ncftransform.c b/src/ncftransform.c | ||
| 69 | index fbabfc3..4c9a56d 100644 | ||
| 70 | --- a/src/ncftransform.c | ||
| 71 | +++ b/src/ncftransform.c | ||
| 72 | @@ -54,7 +54,7 @@ int main(int argc, char **argv) { | ||
| 73 | if (argc != 3 || (STRNEQ(argv[1], "get") && STRNEQ(argv[1], "put"))) | ||
| 74 | die("Usage: ncftransform (put|get) FILE\n"); | ||
| 75 | |||
| 76 | - in_xml = read_file(argv[2], &length); | ||
| 77 | + in_xml = read_file(argv[2], 0, &length); | ||
| 78 | if (in_xml == NULL) | ||
| 79 | die("Failed to read %s\n", argv[2]); | ||
| 80 | |||
| 81 | -- | ||
| 82 | 2.44.0 | ||
| 83 | |||
diff --git a/meta-networking/recipes-support/netcf/netcf_0.2.8.bb b/meta-networking/recipes-support/netcf/netcf_0.2.8.bb index 59ce3e9991..c68974f9f0 100644 --- a/meta-networking/recipes-support/netcf/netcf_0.2.8.bb +++ b/meta-networking/recipes-support/netcf/netcf_0.2.8.bb | |||
| @@ -10,7 +10,7 @@ SRCREV = "2c5d4255857531bc09d91dcd02e86545f29004d4" | |||
| 10 | PV .= "+git" | 10 | PV .= "+git" |
| 11 | 11 | ||
| 12 | SRC_URI = "git://pagure.io/netcf.git;protocol=https;branch=master \ | 12 | SRC_URI = "git://pagure.io/netcf.git;protocol=https;branch=master \ |
| 13 | " | 13 | file://0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch" |
| 14 | 14 | ||
| 15 | UPSTREAM_CHECK_GITTAGREGEX = "release-(?P<pver>(\d+(\.\d+)+))" | 15 | UPSTREAM_CHECK_GITTAGREGEX = "release-(?P<pver>(\d+(\.\d+)+))" |
| 16 | 16 | ||
