Replace all uses of strerror() by ovs_strerror(), for thread safety.
[sliver-openvswitch.git] / lib / stream-fd.c
index 1b16f3e..d102582 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include "fatal-signal.h"
-#include "leak-checker.h"
 #include "poll-loop.h"
 #include "socket-util.h"
 #include "stress.h"
@@ -172,7 +171,7 @@ struct fd_pstream
     char *unlink_path;
 };
 
-static struct pstream_class fd_pstream_class;
+static const struct pstream_class fd_pstream_class;
 
 static struct fd_pstream *
 fd_pstream_cast(struct pstream *pstream)
@@ -234,7 +233,7 @@ pfd_accept(struct pstream *pstream, struct stream **new_streamp)
     if (new_fd < 0) {
         retval = errno;
         if (retval != EAGAIN) {
-            VLOG_DBG_RL(&rl, "accept: %s", strerror(retval));
+            VLOG_DBG_RL(&rl, "accept: %s", ovs_strerror(retval));
         }
         return retval;
     }
@@ -266,7 +265,7 @@ pfd_set_dscp(struct pstream *pstream, uint8_t dscp)
     return 0;
 }
 
-static struct pstream_class fd_pstream_class = {
+static const struct pstream_class fd_pstream_class = {
     "pstream",
     false,
     NULL,