summaryrefslogtreecommitdiff
path: root/lib/json.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-06-24 10:54:49 -0700
committerBen Pfaff <blp@nicira.com>2013-06-28 16:09:38 -0700
commit10a89ef04df5669c5cdd02f786150a7ab8454e01 (patch)
tree8c921735df6d0dca97df88af70e986c4fdf38dca /lib/json.c
parent5fcbed7479c5f1d2cc08c3f544f10dbbe8ec0d90 (diff)
downloadopenvswitch-10a89ef04df5669c5cdd02f786150a7ab8454e01.tar.gz
Replace all uses of strerror() by ovs_strerror(), for thread safety.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/json.c')
-rw-r--r--lib/json.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/json.c b/lib/json.c
index af385c695..56dc5ef72 100644
--- a/lib/json.c
+++ b/lib/json.c
@@ -1026,7 +1026,8 @@ json_from_file(const char *file_name)
stream = fopen(file_name, "r");
if (!stream) {
return json_string_create_nocopy(
- xasprintf("error opening \"%s\": %s", file_name, strerror(errno)));
+ xasprintf("error opening \"%s\": %s", file_name,
+ ovs_strerror(errno)));
}
json = json_from_stream(stream);
fclose(stream);
@@ -1063,7 +1064,7 @@ json_from_stream(FILE *stream)
if (ferror(stream)) {
json_destroy(json);
json = json_string_create_nocopy(
- xasprintf("error reading JSON stream: %s", strerror(errno)));
+ xasprintf("error reading JSON stream: %s", ovs_strerror(errno)));
}
return json;