From: Colin Patrick McCabe Date: Fri, 4 Feb 2011 14:08:41 +0000 (-0800) Subject: cmon: check return code of chdir X-Git-Tag: v0.25~220^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=38877bb8ed83d4fc916fdc0cc8b8fc468cdba7bd;p=ceph.git cmon: check return code of chdir Signed-off-by: Colin McCabe --- diff --git a/src/cmon.cc b/src/cmon.cc index 2ee28e679631..6aea08a1c857 100644 --- a/src/cmon.cc +++ b/src/cmon.cc @@ -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; }