Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use g_spawn_check_wait_status instead of deprecated check_exit_status #42

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/git-evtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
#include <string.h>
#include <errno.h>

#if !GLIB_CHECK_VERSION(2, 70, 0)
/* The functionality of check_wait_status was available under a misleading
* name in older versions of GLib. The argument was always a wait-status,
* not an exit status. */
#define g_spawn_check_wait_status(status, error) g_spawn_check_exit_status (status, error)
#endif

#define EVTAG_SHA512 "Git-EVTag-v0-SHA512:"
#define LEGACY_EVTAG_ARCHIVE_TAR "ExtendedVerify-SHA256-archive-tar:"
#define LEGACY_EVTAG_ARCHIVE_TAR_GITVERSION "ExtendedVerify-git-version:"
Expand Down Expand Up @@ -117,13 +124,13 @@ spawn_sync_require_success (char **argv,
GError **error)
{
gboolean ret = FALSE;
int estatus;
int wait_status;

if (!g_spawn_sync (NULL, argv, NULL,
flags, NULL, NULL,
NULL, NULL, &estatus, error))
NULL, NULL, &wait_status, error))
goto out;
if (!g_spawn_check_exit_status (estatus, error))
if (!g_spawn_check_wait_status (wait_status, error))
goto out;

ret = TRUE;
Expand Down Expand Up @@ -477,7 +484,7 @@ compute_and_append_legacy_archive_checksum (const char *commit,
gssize bytes_read;
char readbuf[4096];
char *gitversion = NULL;
int estatus;
int wait_status;
char *nl;

legacy_checksum_start = g_get_monotonic_time ();
Expand All @@ -504,9 +511,9 @@ compute_and_append_legacy_archive_checksum (const char *commit,
g_string_append (buf, g_checksum_get_string (legacy_archive_sha256));
g_string_append_c (buf, '\n');

if (!g_spawn_command_line_sync ("git --version", &gitversion, NULL, &estatus, error))
if (!g_spawn_command_line_sync ("git --version", &gitversion, NULL, &wait_status, error))
goto out;
if (!g_spawn_check_exit_status (estatus, error))
if (!g_spawn_check_wait_status (wait_status, error))
goto out;

nl = strchr (gitversion, '\n');
Expand Down