]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: check return values
authorSage Weil <sage.weil@dreamhost.com>
Sat, 5 Feb 2011 17:19:06 +0000 (09:19 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 5 Feb 2011 17:19:06 +0000 (09:19 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/msg/SimpleMessenger.cc

index 576f1adef39858132ac39518d1498c5034cf2b6b..dcc4ad7ef329baa3f594289c29fff4d9d80990be 100644 (file)
@@ -1665,7 +1665,11 @@ void SimpleMessenger::Pipe::writer()
       char tag = CEPH_MSGR_TAG_CLOSE;
       state = STATE_CLOSED;
       pipe_lock.Unlock();
-      if (sd) ::write(sd, &tag, 1);
+      if (sd) {
+       int r = ::write(sd, &tag, 1);
+       // we can ignore r, actually; we don't care if this succeeds.
+       r++; r = 0; // placate gcc
+      }
       pipe_lock.Lock();
       continue;
     }
@@ -2413,7 +2417,8 @@ int SimpleMessenger::start(bool nodaemon)
           << dendl;
     }
 
-    daemon(1, 0);
+    int r = daemon(1, 0);
+    assert(r >= 0);
     install_standard_sighandlers();
     write_pid_file(getpid());