MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / CwdGuard

Method CwdGuard

dds/DCPS/FileSystemStorage.cpp:188–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 ACE_TString cwd_;
187
188 explicit CwdGuard(const ACE_TString& dir) {
189 ACE_Vector<ACE_TCHAR> cwd_buf(128);
190 cwd_buf.resize(128, ACE_TCHAR(0));
191
192 while (ACE_OS::getcwd(&cwd_buf[0], cwd_buf.size()) == 0) {
193 if (errno == ERANGE) {
194 cwd_buf.resize(cwd_buf.size() * 2, ACE_TCHAR(0));
195
196 } else break;
197 }
198
199 if (cwd_buf[0]) cwd_ = &cwd_buf[0];
200
201 dds_chdir(dir.c_str());
202 }
203
204 ~CwdGuard() {
205 dds_chdir(cwd_.c_str());

Callers

nothing calls this directly

Calls 2

dds_chdirFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected