diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2016-10-18 12:25:06 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2016-10-20 11:23:56 +0000 |
commit | 631f875ff918f395b0a76cfa5a34bf600321c62d (patch) | |
tree | 8f0452b9d6e5c39ddc08568ffeb5068dd26d56e2 /recipes | |
parent | d1078f579eeba3bc9faf4e49c9e4c5da2f9d1085 (diff) | |
download | meta-boot2qt-631f875ff918f395b0a76cfa5a34bf600321c62d.tar.gz |
ostree: Workaround the SIGCHLD handler issue
Glib overwrites forkfd's SIGCHLD handler, this
breaks QProcess.
This workaround solves the issue for ostree use
case. Other parts of the stack are still affected,
as there might some code elsewhere that uses QProcess
and the buggy Glib subprocess handling code.
Change-Id: I7077ad9479d2c7cc6f1f693b8241bd5bcdc640b2
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/ostree/ostree.bb | 1 | ||||
-rw-r--r-- | recipes/ostree/ostree/Workaround-the-SIGCHLD-handler-issue.patch | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb index 37af99d..5061218 100644 --- a/recipes/ostree/ostree.bb +++ b/recipes/ostree/ostree.bb | |||
@@ -44,6 +44,7 @@ SRC_URI = " \ | |||
44 | file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \ | 44 | file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \ |
45 | file://Create-firmware-convenience-symlinks.patch \ | 45 | file://Create-firmware-convenience-symlinks.patch \ |
46 | file://Print-pull-progress-also-when-not-on-console.patch \ | 46 | file://Print-pull-progress-also-when-not-on-console.patch \ |
47 | file://Workaround-the-SIGCHLD-handler-issue.patch \ | ||
47 | " | 48 | " |
48 | 49 | ||
49 | SRCREV = "8ece4d6d51bdbe3e41ab318259276bb83e553aa0" | 50 | SRCREV = "8ece4d6d51bdbe3e41ab318259276bb83e553aa0" |
diff --git a/recipes/ostree/ostree/Workaround-the-SIGCHLD-handler-issue.patch b/recipes/ostree/ostree/Workaround-the-SIGCHLD-handler-issue.patch new file mode 100644 index 0000000..ece69b8 --- /dev/null +++ b/recipes/ostree/ostree/Workaround-the-SIGCHLD-handler-issue.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From c7cf5cb80c57423e707d87013050c6f9cc6f6d37 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gatis Paeglis <gatis.paeglis@qt.io> | ||
3 | Date: Tue, 18 Oct 2016 12:19:57 +0200 | ||
4 | Subject: [PATCH] Workaround the SIGCHLD handler issue | ||
5 | |||
6 | REF: https://bugreports.qt.io/browse/QTBUG-56338 | ||
7 | --- | ||
8 | src/libostree/ostree-bootloader-grub2.c | 30 ++++++++++++++++++++++-------- | ||
9 | 1 file changed, 22 insertions(+), 8 deletions(-) | ||
10 | |||
11 | diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c | ||
12 | index f3dc8e1..2c60b80 100644 | ||
13 | --- a/src/libostree/ostree-bootloader-grub2.c | ||
14 | +++ b/src/libostree/ostree-bootloader-grub2.c | ||
15 | @@ -380,14 +380,28 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader, | ||
16 | |||
17 | Upstream is fixed though. | ||
18 | */ | ||
19 | - proc = g_subprocess_launcher_spawn (launcher, error, | ||
20 | - grub_exec, "-o", | ||
21 | - gs_file_get_path_cached (new_config_path), | ||
22 | - NULL); | ||
23 | - | ||
24 | - if (!g_subprocess_wait_check (proc, cancellable, error)) | ||
25 | - goto out; | ||
26 | - | ||
27 | + //proc = g_subprocess_launcher_spawn (launcher, error, | ||
28 | + // grub_exec, "-o", | ||
29 | + // gs_file_get_path_cached (new_config_path), | ||
30 | + // NULL); | ||
31 | + | ||
32 | + //if (!g_subprocess_wait_check (proc, cancellable, error)) | ||
33 | + // goto out; | ||
34 | + { | ||
35 | + // REF: https://bugreports.qt.io/browse/QTBUG-56338 | ||
36 | + // We do not use the chroot (grub2_child_setup) code path, so we do not | ||
37 | + // care about GSubprocessLauncher and the custom envvars passed to it. | ||
38 | + const char *cmd = glnx_strjoina (grub_exec, " -o ", gs_file_get_path_cached (new_config_path)); | ||
39 | + FILE *fp = popen(cmd, "r"); | ||
40 | + if (!fp) { | ||
41 | + glnx_set_prefix_error_from_errno (error, "popen (%s)", cmd); | ||
42 | + goto out; | ||
43 | + } | ||
44 | + if (pclose(fp) == -1) { | ||
45 | + glnx_set_prefix_error_from_errno (error, "pclose (%s)", cmd); | ||
46 | + goto out; | ||
47 | + } | ||
48 | + } | ||
49 | /* Now let's fdatasync() for the new file */ | ||
50 | { glnx_fd_close int new_config_fd = open (gs_file_get_path_cached (new_config_path), O_RDONLY | O_CLOEXEC); | ||
51 | if (new_config_fd < 0) | ||
52 | -- | ||
53 | 2.7.4 | ||
54 | |||