[libvirt] [PATCH] openvz_conf.c: remove dead store to "p"; use strchrnul

I may separate this into two commits. Currently we can't use the part that adds the strchrnul use, since gnulib's module lists its license as LGPL, which means LGPLv3+, and that conflicts with libvirt's LGPLv2+ requirement. However, since strchrnul is derived from glibc, it should be easy to adjust that. I've asked the maintainer of that module on the bug-gnulib list. We'll see later today when the US wakes up.
From b76bc73df65c793958ce646fd80763c19a9e4dbd Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 8 Sep 2009 11:07:32 +0200 Subject: [PATCH] openvz_conf.c: remove dead store to "p"; use strchrnul
* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded while loop with equivalent use of strchrnul. * bootstrap (modules): Add strchrnul. --- bootstrap | 1 + src/openvz_conf.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap b/bootstrap index 8b81e0e..5560792 100755 --- a/bootstrap +++ b/bootstrap @@ -89,6 +89,7 @@ send setsockopt socket stpcpy +strchrnul strndup strerror strsep diff --git a/src/openvz_conf.c b/src/openvz_conf.c index ce4fc6e..be94b9e 100644 --- a/src/openvz_conf.c +++ b/src/openvz_conf.c @@ -239,15 +239,14 @@ openvzReadNetworkConf(virConnectPtr conn, net->type = VIR_DOMAIN_NET_TYPE_BRIDGE; - char *p = token, *next = token; + char *p = token; char cpy_temp[32]; int len; /*parse string*/ do { - while (*next != '\0' && *next != ',') next++; + char *next = strchrnul (token, ','); if (STRPREFIX(p, "ifname=")) { - p += 7; /* skip in libvirt */ } else if (STRPREFIX(p, "host_ifname=")) { p += 12; -- 1.6.5.rc0.164.g5f6b0

Jim Meyering wrote:
I may separate this into two commits. Currently we can't use the part that adds the strchrnul use, since gnulib's module lists its license as LGPL, which means LGPLv3+, and that conflicts with libvirt's LGPLv2+ requirement. However, since strchrnul is derived from glibc, it should be easy to adjust that. I've asked the maintainer of that module on the bug-gnulib list. We'll see later today when the US wakes up.
The licenses of the strchrnul module and its dependent, rawmemchr, have been relaxed to LGPLv2+, so to get that updated in gnulib, I've added a preceding commit that adjusts libvirt's .gnulib submodule to use latest commit from upstream gnulib. With that, autogen.sh notices the change and automatically runs ./bootstrap. I confirmed that "make check" passes all tests.
From b76bc73df65c793958ce646fd80763c19a9e4dbd Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 8 Sep 2009 11:07:32 +0200 Subject: [PATCH] openvz_conf.c: remove dead store to "p"; use strchrnul
* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded while loop with equivalent use of strchrnul. * bootstrap (modules): Add strchrnul.

On Tue, Sep 08, 2009 at 08:21:44PM +0200, Jim Meyering wrote:
Jim Meyering wrote:
I may separate this into two commits. Currently we can't use the part that adds the strchrnul use, since gnulib's module lists its license as LGPL, which means LGPLv3+, and that conflicts with libvirt's LGPLv2+ requirement. However, since strchrnul is derived from glibc, it should be easy to adjust that. I've asked the maintainer of that module on the bug-gnulib list. We'll see later today when the US wakes up.
The licenses of the strchrnul module and its dependent, rawmemchr, have been relaxed to LGPLv2+, so to get that updated in gnulib, I've added a preceding commit that adjusts libvirt's .gnulib submodule to use latest commit from upstream gnulib.
With that, autogen.sh notices the change and automatically runs ./bootstrap.
I confirmed that "make check" passes all tests.
From b76bc73df65c793958ce646fd80763c19a9e4dbd Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 8 Sep 2009 11:07:32 +0200 Subject: [PATCH] openvz_conf.c: remove dead store to "p"; use strchrnul
* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded while loop with equivalent use of strchrnul. * bootstrap (modules): Add strchrnul.
ACK thanks, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
Jim Meyering