1. 26 Dec, 2018 1 commit
    • Vasily Galkin's avatar
      gspawn, tests: extend spawn_test, run it on win32 · 50cb4f22
      Vasily Galkin authored
      The spawn_test is enabled on win32 meson build, both msys and msvc.
      
      Some modifications to make it useful for auto-testing on win32:
      - use own argv0 to find helper win32-specific subprogram
      - helper subprogram and conditions changed, so testing is fully
      automated instead of manually checking contents of some MessageBoxes
      
      Redirection test checks "sort" output for locale-independent string
      instead of relying on "netstat" locale-dependent string.
      Also with "sort" it become usable on unix, so enabled there too.
      Currently this fails on win32 with coverage since
      some coverage-realted error output from gpawn-win32-helper
      is unexpectedly treated as executed subprocess output.
      
      
      Added test checking "sort" with error-only redirection. This also fails
      on win32 by now, due to a typo in gspawn-win32.c (checks for stdout
      redirection instead of stderr)
      50cb4f22
  2. 03 Aug, 2017 1 commit
    • Philip Withnall's avatar
      Consistently save errno immediately after the operation setting it · 5cddde1f
      Philip Withnall authored
      Prevent the situation where errno is set by function A, then function B
      is called (which is typically _(), but could be anything else) and it
      overwrites errno, then errno is checked by the caller.
      
      errno is a horrific API, and we need to be careful to save its value as
      soon as a function call (which might set it) returns. i.e. Follow the
      pattern:
        int errsv, ret;
        ret = some_call_which_might_set_errno ();
        errsv = errno;
      
        if (ret < 0)
          puts (strerror (errsv));
      
      This patch implements that pattern throughout GLib. There might be a few
      places in the test code which still use errno directly. They should be
      ported as necessary. It doesn’t modify all the call sites like this:
        if (some_call_which_might_set_errno () && errno == ESOMETHING)
      since the refactoring involved is probably more harmful than beneficial
      there. It does, however, refactor other call sites regardless of whether
      they were originally buggy.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=785577
      5cddde1f
  3. 31 Mar, 2004 1 commit
  4. 10 Mar, 2004 1 commit
  5. 17 Nov, 2002 1 commit
    • Tor Lillqvist's avatar
      Ignore the G_SPAWN_DO_NOT_REAP_CHILD flag, can't be meaninfully · 1f04f2cc
      Tor Lillqvist authored
      2002-11-17  Tor Lillqvist  <tml@iki.fi>
      
      	* glib/gspawn-win32.c (g_spawn_async_with_pipes): Ignore the
      	G_SPAWN_DO_NOT_REAP_CHILD flag, can't be meaninfully implemented
      	on Windows, at least not now. Always pass dont_wait as TRUE to
      	do_spawn_with_pipes(). The semantics of the dont_wait parameter is
      	very different from the semantics of the intermediate_child
      	parameter to fork_exec_with_pipes() in the Unix version. This
      	fixes a serious bug, g_spawn_async() in fact behaved
      	synchronously.
      
      	(do_spawn_with_pipes, do_spawn): Rename from
      	fork_exec_with_pipes() and do_exec(), those names were from the
      	Unix bersion, and misleading.
      
      	(close_and_invalidate): Don't try to close invalid fds.
      
      	* glib/gspawn.c (g_spawn_async_with_pipes): Add warning about
      	Windows behaviour. There is no fork(), so the child_setup()
      	function is in fact called in the parent.
      
      	* glib/gspawn-win32-helper.c (WinMain): Insert spaces in argv
      	debugging output.
      
      	* tests/spawn-test-win32-gui.c: New file. Test program to be
      	linked as a GUI application. Behaves differently depending on how
      	invoked (by spawn-test).
      
      	* tests/spawn-test.c (run_tests): On Win32, run the
      	spawn-test-win32-gui program, too, in several ways, synchronously
      	and asynchronously.
      
      	* tests/Makefile.am: Corresponding change.
      1f04f2cc