Skip to content

Commit 6402e63

Browse files
committed
update
1 parent 96418c2 commit 6402e63

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

aws-runtime/aws-config/mingw/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandMingw.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
*/
55
package aws.smithy.kotlin.runtime.client.util
66

7-
import aws.sdk.kotlin.runtime.util.SdkDispatchers // adjust import
7+
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderException
8+
import aws.smithy.kotlin.runtime.io.internal.SdkDispatchers
9+
import aws.smithy.kotlin.runtime.time.Clock
10+
import aws.smithy.kotlin.runtime.util.PlatformProvider
811
import kotlinx.cinterop.*
912
import kotlinx.coroutines.withContext
1013
import platform.posix._wunlink // to delete the temp file afterwards

aws-runtime/aws-config/posix/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandPosix.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,9 @@ internal actual suspend fun executeCommand(
4747
close(writeFd)
4848
}
4949

50-
val shell = when (platformProvider.osInfo().family) {
51-
OsFamily.Windows -> "C:\\Windows\\System32\\cmd.exe"
52-
else -> "/bin/sh"
53-
}
54-
55-
val shellArg = when (platformProvider.osInfo().family) {
56-
OsFamily.Windows -> "/C"
57-
else -> "-c"
58-
}
59-
6050
memScoped {
61-
val argv = (arrayOf(shell, shellArg, command).map { it.cstr.ptr } + null).toCValues()
62-
execvp(shell, argv)
51+
val argv = (arrayOf("/bin/sh", "-c", command).map { it.cstr.ptr } + null).toCValues()
52+
execvp("/bin/sh", argv)
6353
}
6454
_exit(127) // If exec fails
6555
}

0 commit comments

Comments
 (0)