From 712f589ad61f8cd1fea607a82d55c4219b4328fe Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Fri, 4 Feb 2011 08:50:43 -0800 Subject: [PATCH] cmds: check return code of chdir Signed-off-by: Colin McCabe --- src/cmds.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmds.cc b/src/cmds.cc index cfe66911641d3..7b0bb2564294c 100644 --- a/src/cmds.cc +++ b/src/cmds.cc @@ -191,8 +191,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) << "cmds: gmon.out should be in " << s << dendl; + } generic_dout(0) << "stopped." << dendl; } -- 2.39.5