After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619564 - [Win32] do_spawn_directly problems
[Win32] do_spawn_directly problems
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-24 23:37 UTC by Morten Welinder
Modified: 2018-05-24 12:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Tentative patch (4.11 KB, patch)
2010-05-25 00:44 UTC, Morten Welinder
none Details | Review

Description Morten Welinder 2010-05-24 23:37:55 UTC
In gspawn-win32.c, I see the following near line 486:

  g_free (wargv0);
  g_strfreev ((gchar **) wargv);
  g_strfreev ((gchar **) wenvp);

  saved_errno = errno;

  if (rc == -1 && saved_errno != 0)
    {
      g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
		   _("Failed to execute child process (%s)"),
		   g_strerror (saved_errno));
      return FALSE;
    }

There are two problems with this:

1. "errno" is saved too late.  It must be saved before the free-ing.
2. G_SPAWN_ERROR_FAILED --> G_SPAWN_ERROR_NOENT to match what happens
   on the Linux side.
Comment 1 Morten Welinder 2010-05-24 23:44:10 UTC
Actually, let me rephrase item 2.

On Linux, I get G_SPAWN_ERROR_NOENT when the program isn't found.  It is
useful to distinguish this error from others -- I use

    g_error_matches (*err, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT)

to test for this and replace the error message with something mentioning
the URL of where to get the program in question.  On win32 I just get
"something went wrong" which isn't as useful.
Comment 2 Morten Welinder 2010-05-25 00:44:49 UTC
Created attachment 161902 [details] [review]
Tentative patch

Something like this should fix it.
Comment 3 GNOME Infrastructure Team 2018-05-24 12:20:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/303.