0002-exec-Fix-deprecated-glib-function-call.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. From aad927a81fd9067865dc391c5bbff12ac51a0002 Mon Sep 17 00:00:00 2001
  2. From: Manuel Wassermann <manuel.wassermann97@gmail.com>
  3. Date: Thu, 1 Jul 2021 04:45:49 +0200
  4. Subject: [PATCH] exec: Fix deprecated glib function call Glib will rename
  5. "g_spawn_check_exit_status()" to "g_spawn_check_wait_status()" in version
  6. 2.69.
  7. [Retrieved from:
  8. https://github.com/storaged-project/libblockdev/commit/aad927a81fd9067865dc391c5bbff12ac51a0002]
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. ---
  11. src/utils/exec.c | 7 ++++++-
  12. 1 file changed, 6 insertions(+), 1 deletion(-)
  13. diff --git a/src/utils/exec.c b/src/utils/exec.c
  14. index 317fb5525..8faeb289c 100644
  15. --- a/src/utils/exec.c
  16. +++ b/src/utils/exec.c
  17. @@ -236,7 +236,12 @@ gboolean bd_utils_exec_and_report_status_error (const gchar **argv, const BDExtr
  18. /* g_spawn_sync set the status in the same way waitpid() does, we need
  19. to get the process exit code manually (this is similar to calling
  20. WEXITSTATUS but also sets the error for terminated processes */
  21. - if (!g_spawn_check_exit_status (exit_status, error)) {
  22. +
  23. + #if !GLIB_CHECK_VERSION(2, 69, 0)
  24. + #define g_spawn_check_wait_status(x,y) (g_spawn_check_exit_status (x,y))
  25. + #endif
  26. +
  27. + if (!g_spawn_check_wait_status (exit_status, error)) {
  28. if (g_error_matches (*error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED)) {
  29. /* process was terminated abnormally (e.g. using a signal) */
  30. g_free (stdout_data);