1. 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
        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.
  2. 14 Jun, 2017 1 commit
  3. 29 May, 2017 1 commit
  4. 28 Apr, 2017 1 commit
    • Philip Withnall's avatar
      docs: Fix (nullable) (optional) annotations · b63469d7
      Philip Withnall authored
      There are a few places where commit 18a33f72 replaced valid (nullable)
      (optional) annotations with just (optional). That has a different
      (nullable) (optional) can only be applied to gpointer* parameters, and
      means that both the gpointer* and returned gpointer can be NULL. i.e.
      The caller can pass in NULL to ignore the return value; and the returned
      value can be NULL.
      (optional) can be applied to anything* parameters, and means that the
      anything* can be NULL. i.e. The caller can pass in NULL to ignore the
      return value. The return value cannot be NULL.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
  5. 03 Apr, 2017 1 commit
  6. 05 Dec, 2016 1 commit
    • Sebastian Dröge's avatar
      GSocket: Fix race conditions on Win32 if multiple threads are waiting on... · 799f8dcd
      Sebastian Dröge authored
      GSocket: Fix race conditions on Win32 if multiple threads are waiting on conditions for the same socket
      WSAWaitForMultipleEvents() only returns for one of the waiting threads, and
      that one might not even be the one waiting for the condition that changed. As
      such, only let a single thread wait on the event and use a GCond for all other
      With this it is possible to e.g. have an UDP socket that is written to from
      one thread and read from in another thread on Win32 too. On POSIX systems this
      was working before already.
  7. 22 Nov, 2016 1 commit
  8. 20 Nov, 2016 1 commit
  9. 12 Jul, 2016 1 commit
  10. 04 May, 2016 1 commit
  11. 02 Feb, 2016 1 commit
  12. 13 Oct, 2015 1 commit
  13. 05 Oct, 2015 2 commits
  14. 04 Oct, 2015 2 commits
  15. 01 Oct, 2015 5 commits
  16. 28 Sep, 2015 3 commits
  17. 29 Aug, 2015 1 commit
  18. 23 Jul, 2015 1 commit
  19. 02 Jul, 2015 1 commit
    • Stef Walter's avatar
      gsocket: Don't g_error() if file-descriptor is not a socket · f405f421
      Stef Walter authored
      This code was out of date with current coding practices.
      Nowadays it's common to receive file descriptors over environment
      variables from other processes like systemd. The unit files that
      control these file descriptors are configurable by sysadmins.
      It is not (necessarily) a programmer error when g_socket_details_from_fd()
      is called with a file descriptor that is not a socket. It can also
      be a system and/or configuration error.
  20. 21 Jun, 2015 1 commit
  21. 21 Mar, 2015 1 commit
  22. 06 Mar, 2015 1 commit
    • Chun-wei Fan's avatar
      Windows: Use Standard Networking Functions If Possible · 6fe28eef
      Chun-wei Fan authored
      Currently, the Windows code use Winsock2-specific APIs to try to emulate
      calls such as inet_pton(), inet_ntop() and if_nametoindex(), which may not
      do the job all the time.  On Vista and later, Winsock2 does provide a
      proper implementation for these functions, so we can use them if they exist
      on the system, by querying for them during g_networking_init().  Otherwise,
      we continue to use the original code path for these, in the case of XP and
      Server 2003.
      This enables many of the network-address tests to pass on Windows as a
      result, when the native Winsock2 implementations can be used.
  23. 17 Jan, 2015 1 commit
  24. 11 Dec, 2014 1 commit
  25. 21 Jul, 2014 2 commits
  26. 28 Jun, 2014 1 commit
  27. 23 Jun, 2014 1 commit
  28. 15 May, 2014 1 commit
  29. 16 Apr, 2014 1 commit
  30. 30 Mar, 2014 1 commit
    • Dan Winship's avatar
      gio: move Winsock error mapping to g_io_error_from_win32_error() · 3da5d590
      Dan Winship authored
      Rather than having special code in gsocket.c, handle Winsock errors
      along with other Win32 errors in gioerror.c
      Also, reference g_win32_error_message() from the
      g_io_error_from_win32_error() docs, and update the
      g_win32_error_message() docs to clarify that it works with Winsock
      error codes too.
  31. 23 Mar, 2014 1 commit