Skip to content

Commit 8b5bc8f

Browse files
committed
[crun] Fix exit called on exec fail
When exec failed after forking, crun reported error that in return called exit(). This is fine for crun executable, but when using it as a library, this calls atexit ovservers of parent process. It was fixed by changing exit() to _exit()
1 parent 070f2bd commit 8b5bc8f

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

package/crun/0001-Preparing-for-library-build.patch

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 9d14b28d5c5748abd3d073fbf65dd4cb6b50fdec Mon Sep 17 00:00:00 2001
1+
From 5edb3adc3a5d64113d056da46db634ecc2871e75 Mon Sep 17 00:00:00 2001
22
From: Michal Pogoda <michalpogoda@hotmail.com>
33
Date: Tue, 17 Mar 2020 16:55:20 +0100
44
Subject: [PATCH 1/2] Preparing for library build
@@ -9,7 +9,8 @@ Subject: [PATCH 1/2] Preparing for library build
99
libcrun.pc.in | 11 +++++++++++
1010
libocispec/Makefile.am | 13 +++----------
1111
src/libcrun/container.c | 2 +-
12-
5 files changed, 38 insertions(+), 12 deletions(-)
12+
src/libcrun/error.c | 2 +-
13+
6 files changed, 39 insertions(+), 13 deletions(-)
1314
create mode 100644 libcrun.pc.in
1415

1516
diff --git a/Makefile.am b/Makefile.am
@@ -130,6 +131,19 @@ index 22cb41f..7f7dafc 100644
130131
+ _exit (ret);
131132
}
132133

134+
int
135+
diff --git a/src/libcrun/error.c b/src/libcrun/error.c
136+
index cb49b0d..56ea309 100644
137+
--- a/src/libcrun/error.c
138+
+++ b/src/libcrun/error.c
139+
@@ -386,7 +386,7 @@ libcrun_fail_with_error (int errno_, const char *msg, ...)
140+
va_start (args_list, msg);
141+
write_log (errno_, false, msg, args_list);
142+
va_end (args_list);
143+
- exit (EXIT_FAILURE);
144+
+ _exit (EXIT_FAILURE);
145+
}
146+
133147
int
134148
--
135149
2.20.1

package/crun/0002-Fix-cpuacct-not-beeing-created.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From b8c2ac52796824ba32329617f2113f26e88a2e1b Mon Sep 17 00:00:00 2001
1+
From 0679805f6105d6b226fda00d265bdb3690eeeda2 Mon Sep 17 00:00:00 2001
22
From: Michal Pogoda <michalpogoda@hotmail.com>
33
Date: Thu, 9 Apr 2020 16:07:43 +0200
44
Subject: [PATCH 2/2] Fix cpuacct not beeing created

0 commit comments

Comments
 (0)