[libteam/f16: 2/2] teamd: use json is_error macro for json_tokener_parse() result check
Jiří Pírko
jirka at fedoraproject.org
Wed Jan 25 14:55:09 UTC 2012
commit 92bf869d28e1f4d69470aee85730a04864d559f9
Author: Jiri Pirko <jpirko at redhat.com>
Date: Wed Jan 25 15:54:07 2012 +0100
teamd: use json is_error macro for json_tokener_parse() result check
libteam.spec | 5 +++
...son-is_error-macro-for-json_tokener_parse.patch | 33 ++++++++++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/libteam.spec b/libteam.spec
index 7996c2f..61ba34f 100644
--- a/libteam.spec
+++ b/libteam.spec
@@ -21,6 +21,9 @@ BuildRequires: libnl3-devel
BuildRequires: python-devel
BuildRequires: swig
+# F16 specific patch, not upstream
+Patch0: teamd-use-json-is_error-macro-for-json_tokener_parse.patch
+
%description
This package contains a library which is a user-space
counterpart for team network driver. It provides an API
@@ -63,6 +66,7 @@ programs that will manipulate team network devices.
%prep
%setup -q
+%patch0 -p1
# prepare example dir for -devel
mkdir -p _tmpdoc1/examples
@@ -114,6 +118,7 @@ python ./setup.py install --root $RPM_BUILD_ROOT -O1
%changelog
* Wed Jan 25 2012 Jiri Pirko <jpirko at redhat.com> - 0.1-2.20120125gita1718f8
+- teamd: use json is_error macro for json_tokener_parse() result check
- Rebase to git commit a1718f8
* Wed Jan 18 2012 Jiri Pirko <jpirko at redhat.com> - 0.1-1.20120113git302672e
diff --git a/teamd-use-json-is_error-macro-for-json_tokener_parse.patch b/teamd-use-json-is_error-macro-for-json_tokener_parse.patch
new file mode 100644
index 0000000..647bd2d
--- /dev/null
+++ b/teamd-use-json-is_error-macro-for-json_tokener_parse.patch
@@ -0,0 +1,33 @@
+From 565e6d48fa450849ecae663bca5cb6fa0c2a63c1 Mon Sep 17 00:00:00 2001
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Wed, 25 Jan 2012 14:23:22 +0100
+Subject: [patch f16-libteam] teamd: use json is_error macro for
+ json_tokener_parse() result check
+
+upstream libteam does not use this because is_error is very general name
+and ugly to use. Also, json_tokener_parse() returns NULL on error now
+(upstream git, rawhide versions of json-c)
+
+So just for f16 use is_error here.
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+---
+ teamd/teamd.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/teamd/teamd.c b/teamd/teamd.c
+index 08625d1..5319c01 100644
+--- a/teamd/teamd.c
++++ b/teamd/teamd.c
+@@ -328,7 +328,7 @@ static int load_config(struct teamd_context *ctx)
+ }
+ if (ctx->config_text) {
+ ctx->config_jso = json_tokener_parse(ctx->config_text);
+- if (!ctx->config_jso) {
++ if (is_error(ctx->config_jso)) {
+ teamd_log_err("Failed to parse configuration.");
+ return -EIO;
+ }
+--
+1.7.7.6
+
More information about the scm-commits
mailing list