Skip to content

Commit 30403a1

Browse files
committed
getcwd error ignore
1 parent 1b13794 commit 30403a1

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
77
BUILD_TYPE: Release
88
PACKAGE_NAME: docker-runner-php
9-
PACKAGE_VERSION: 1.0.0-1
9+
PACKAGE_VERSION: 1.0.1-1
1010
ARCH: amd64
1111

1212
jobs:

cdocker.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,9 @@ int CDocker::run(const std::string& hostname, int selectedVersion, std::vector<s
270270
memset(cwd,0,PATH_MAX);
271271

272272
if (getcwd(cwd, PATH_MAX) == nullptr) {
273-
perror("ERROR: getcwd()");
274-
throw std::runtime_error( "getcwd failed" );
273+
cwd[0] = 0;
274+
//perror("ERROR: getcwd()");
275+
//throw std::runtime_error( "getcwd failed" );
275276
}
276277

277278
if (original_uid != 0) {
@@ -316,7 +317,7 @@ int CDocker::run(const std::string& hostname, int selectedVersion, std::vector<s
316317
if (seteuid(original_uid) != 0)
317318
throw std::runtime_error("seteuid failed.");
318319

319-
if (chdir(cwd) != 0) {
320+
if (cwd[0] && chdir(cwd) != 0) {
320321

321322
}
322323

0 commit comments

Comments
 (0)