]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/fd: port dump_open_fds() to osx
authorKefu Chai <kchai@redhat.com>
Sat, 9 Sep 2017 14:45:27 +0000 (22:45 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 16 Sep 2017 02:43:32 +0000 (10:43 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/fd.cc

index 243b1ebfcc33d53fb69a7d447e80a652f5634ba7..931d4353c2b8bb64ee67e4669778eeab1a7518af 100644 (file)
 
 void dump_open_fds(CephContext *cct)
 {
+#ifdef __APPLE__
+  const char *fn = "/dev/fd";
+#else
   const char *fn = PROCPREFIX "/proc/self/fd";
+#endif
   DIR *d = opendir(fn);
   if (!d) {
     lderr(cct) << "dump_open_fds unable to open " << fn << dendl;