Skip to content

Commit 9578a1e

Browse files
committed
Add the error in the metadata of the log when failing to set pgrp of fd back to original value
1 parent 0036723 commit 9578a1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ProcessInvocation/ProcessInvocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ public struct ProcessInvocation : AsyncSequence {
711711
/* Let’s revert the fg pg ID back to the original value. */
712712
Conf.logger?.debug("Setting pgrp of input fd back to original value.", metadata: ["fd": "\(fgPgIDSetInfo.destFd)", "value": "\(fgPgIDSetInfo.originalValue)"])
713713
if tcsetpgrp(fgPgIDSetInfo.destFd.rawValue, fgPgIDSetInfo.originalValue) != 0 && errno != ENOTTY {
714-
Conf.logger?.error("Failed setting foreground process group ID of controlling terminal of redirected stdin back to the original value.")
714+
Conf.logger?.error("Failed setting foreground process group ID of controlling terminal of redirected stdin back to the original value.", metadata: ["error": "\(Errno(rawValue: errno))"])
715715
}
716716
}
717717
signalCleanupHandler()

0 commit comments

Comments
 (0)