]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmon: check return code of chdir
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 4 Feb 2011 14:08:41 +0000 (06:08 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 4 Feb 2011 14:08:41 +0000 (06:08 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/cmon.cc

index 2ee28e6796316b71f1f4f8bf9178b799e7b425ef..6aea08a1c85744e958e1208779c25fd2642a7403 100644 (file)
@@ -245,8 +245,9 @@ int main(int argc, const char **argv)
   // cd on exit, so that gmon.out (if any) goes into a separate directory for each node.
   char s[20];
   snprintf(s, sizeof(s), "gmon/%d", getpid());
-  if (mkdir(s, 0755) == 0)
-    chdir(s);
+  if ((mkdir(s, 0755) == 0) && (chdir(s) == 0)) {
+    dout(0) << "cmon: gmon.out should be in " << s << dendl;
+  }
 
   return 0;
 }