Merge pull request #43578 from vsiddharth/pause-container
Automatic merge from submit-queue Improve pause-container warning message Signed-off-by: Vinothkumar Siddharth <sidvin@amazon.com> **What this PR does / why we need it**: This just improves the warning message currently emitted by pause **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
@@ -27,14 +27,13 @@ static void sigdown(int signo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void sigreap(int signo) {
|
static void sigreap(int signo) {
|
||||||
while (waitpid(-1, NULL, WNOHANG) > 0)
|
while (waitpid(-1, NULL, WNOHANG) > 0);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
if (getpid() != 1)
|
if (getpid() != 1)
|
||||||
/* Not an error because pause sees use outside of infra containers. */
|
/* Not an error because pause sees use outside of infra containers. */
|
||||||
fprintf(stderr, "Warning: pause should be the first process in a pod\n");
|
fprintf(stderr, "Warning: pause should be the first process\n");
|
||||||
|
|
||||||
if (sigaction(SIGINT, &(struct sigaction){.sa_handler = sigdown}, NULL) < 0)
|
if (sigaction(SIGINT, &(struct sigaction){.sa_handler = sigdown}, NULL) < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user