]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
proflogger: Fix compiler warnings
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 19 Jul 2011 00:21:37 +0000 (17:21 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 19 Jul 2011 00:21:37 +0000 (17:21 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/ProfLogger.cc
src/test/proflogger.cc

index 6cf012fffcf4505fb2d0ae003b1b16fdff22ec67..1332a92c803d2f40c050b723d71fba0a2fda3453 100644 (file)
@@ -150,7 +150,8 @@ public:
     struct sockaddr_un address;
     memset(&address, 0, sizeof(struct sockaddr_un));
     address.sun_family = AF_UNIX;
-    snprintf(address.sun_path, sizeof(sockaddr_un::sun_path), sock_path.c_str());
+    snprintf(address.sun_path, sizeof(sockaddr_un::sun_path),
+            "%s", sock_path.c_str());
     if (bind(sock_fd, (struct sockaddr*)&address,
               sizeof(struct sockaddr_un)) != 0) {
       int err = errno;
@@ -380,7 +381,7 @@ init(const std::string &uri)
 
   /* Set up things for the new thread */
   std::string err;
-  int pipe_rd, pipe_wr;
+  int pipe_rd = -1, pipe_wr = -1;
   err = ProfLogThread::create_shutdown_pipe(&pipe_rd, &pipe_wr);
   if (!err.empty()) {
     lderr(m_cct) << "ProfLoggerCollection::init: error: " << err << dendl;
index f2c897d6f29286d6611db1382c24222a83973bd2..0bd8338e148fe4cb761aeaa997b2fdbd4d2cfc8c 100644 (file)
@@ -106,7 +106,7 @@ public:
     struct sockaddr_un address;
     memset(&address, 0, sizeof(struct sockaddr_un));
     address.sun_family = AF_UNIX;
-    snprintf(address.sun_path, sizeof(address.sun_path), m_uri.c_str());
+    snprintf(address.sun_path, sizeof(address.sun_path), "%s", m_uri.c_str());
 
     if (connect(socket_fd, (struct sockaddr *) &address, 
          sizeof(struct sockaddr_un)) != 0) {