2008-08-23 Tor Lillqvist <tml@novell.com>
Bug 548988 - g_file_replace fails on Windows when the target file
exists already
* glocalfileoutputstream.c (g_local_file_output_stream_close): On
Windows, close the file before renaming it (in case we have been
writing to a file with a temporary name).
(g_local_file_output_stream_close, handle_overwrite_open): Use
GLocalFileStat instead of plain struct stat, for passing to
_g_local_file_info_create_etag(). Thus also use _fstati64()
instead of plain fstat() on Windows.
svn path=/trunk/; revision=7388
2008-08-22 Björn Lindqvist <bjourne@gmail.com>
Bug 523939 – Example program for GValue
* gobject/gvalue.c: Add code example that demonstrates GValue's
features.
svn path=/trunk/; revision=7387
2008-08-21 Tor Lillqvist <tml@novell.com>
* glib/giowin32.c: Don't bother compiling the binary
compatibility g_io_channel_win32_new_stream_socket()
function that has not been mentioned in any header since 2.0 on
Win64.
* glib/glib.symbols: Mark it, too, private, and don't export it on
Win64.
svn path=/trunk/; revision=7384
2008-08-21 Johan Dahlin <johan@gnome.org>
* gobject.h:
Mark g_object_get_type function as const, it's
a fundamental type and can safely marked as const,
as opposed to traditionally *_get_type functions.
svn path=/trunk/; revision=7378
2008-08-21 Tor Lillqvist <tml@novell.com>
* glib/gmain.c: Rework the g_poll() implementation on Windows to
match poll() semantics more closely. This makes the test program
in bug #468910 behave better and doesn't seem to break anything
else.
If polling several GPollFDs, i.e. messages and/or waitable
handles, first check if one or several of them are in the
signalled state right away, and return indication for all that are
in that case.
If not, then poll with timeout and indicate only the single one
that the Win32 wait function tells us as before.
Remove unnecessary ifdefs, as we always have G_MAIN_POLL_DEBUG
defined on Windows.
Initialise g_main_poll_debug in g_main_context_new() so we have it
before testing it in one case.
Don't add several copies of a handle in the array of handles to
wait for. The documentation says this is not allowed, although it
did seem to work fine in practise. But do as the documentations
says anyway.
svn path=/trunk/; revision=7375
2008-08-20 Johan Dahlin <johan@gnome.org>
Bug 548689 – The type name for GParamSpec is wrong
* gparam.c (g_param_type_init):
Register the type name as GParam instead of GParamSpec.
svn path=/trunk/; revision=7374
2008-08-20 Tor Lillqvist <tml@novell.com>
Bug 500246 - Bug fixes for giowin32
* glib/giowin32.c (read_thread) (write_thread): Change the nbytes
variables to signed.
(g_io_channel_win32_make_pollfd): Fix an obvious error in the file
descriptor case leftover after the patch from bug #333098 on
2006-03-02. Thanks to Marcus Brinkmann.
svn path=/trunk/; revision=7373
2008-08-20 Tor Lillqvist <tml@novell.com>
Bug 324234 - Using g_io_add_watch_full() to wait for connect() to
return on a non-blocking socket returns prematurely
Bug 548278 - Async GETs connections are always terminated
unexpectedly on Windows
* glib/giowin32.c: Add one more state variable to the
GIOWin32Channel struct, ever_writable. Initialise it to FALSE, set
to TRUE when the WSAEventSelect() indicates FD_WRITE, and never
reset to FALSE.
Don't do the WSASetEvent() in g_io_win32_prepare() unless
ever_writable is TRUE. Don't automatically indicate G_IO_OUT in
g_io_win32_check() unless ever_writable is TRUE.
This fixes the behaviour of the test case program in bug #548278,
and the "Testcase for the spurious OUT event bug" in bug
#324234. It also doesn't seem to break anything. Not that there is
any exhaustive test suite...
Add a comment with a list of bugs that are related to the code in
this file.
svn path=/trunk/; revision=7372
* gthread-impl.c: Implement g_thread_init_with_errorcheck_mutexes
in the !G_THREAD_ENABLED case. Pointed out by Jan Nieuwenhuizen
svn path=/trunk/; revision=7364
2008-08-15 Tor Lillqvist <tml@novell.com>
* glib/tmpl/threads.sgml: Add an exception: g_mem_set_vtable() may
be called before g_thread_init().
svn path=/trunk/; revision=7361
2008-08-15 12:41:26 Tim Janik <timj@imendio.com>
* glib/gtestutils.c: changed assertion messages, so older emacsen
can also detect failing source file and line, fixes:
Bug 502498 – Test framework assertion failures should follow gcc error format
svn path=/trunk/; revision=7358
2008-08-15 Tor Lillqvist <tml@novell.com>
* glib/tmpl/threads.sgml: Warn about the consequences of not
calling g_thread_init() first, if it will be called at all. Advice
calling it if using random GLib-based libraries.
svn path=/trunk/; revision=7355
2008-08-13 Matthias Clasen <mclasen@redhat.com>
Bug 547637 – unconditional #include of sys/statfs.h in configure
impedes detection of statfs things if non-existant
* configure.in: Protect the statfs.h include by guards.
svn path=/trunk/; revision=7352
2008-08-13 Tor Lillqvist <tml@novell.com>
* win32/gwinhttpvfs.c
* win32/gwinhttpvfs.h
* win32/gwinhttpfile.c
* win32/gwinhttpfileinputstream.c
* win32/gwinhttpfileoutputstream.c: Refactor some common code
snippets into helper functions. Check HTTP response status
codes. Implement g_winhttp_file_query_info(), looking at
Content-Length, Content-Type and Last-Modified.
* win32/winhttp.h: Add some symbolic constants that are not
publicly documented. Just a handful, so it should be OK to use
information from the Windows SDK's headers.
svn path=/trunk/; revision=7350
2008-08-13 Tor Lillqvist <tml@novell.com>
Bug 546582 - Callbacks from GFileMonitor present a GFile in the
wrong folder
* win32/gwin32directorymonitor.c
(g_win32_directory_monitor_callback): Patch by Erik van Pienbroek.
svn path=/trunk/; revision=7347
2008-08-13 Tor Lillqvist <tml@novell.com>
* win32/gwinhttpfileoutputstream.c
(g_winhttp_file_output_stream_write): Don't write the
Content-Length header ourselves, WinHttpSendRequest() takes care
of that when the dwTotalLength parameter is non-zero. Increment
offset by the number of actual bytes sent, although I wonder if
such a scenario is possible where less than requested would be
sent and accepted by the server without errors.
svn path=/trunk/; revision=7345
2008-08-13 Tor Lillqvist <tml@novell.com>
* win32/gwinhttpvfs.c
* win32/gwinhttpvfs.h
* win32/gwinhttpfile.c
* win32/gwinhttpfile.h
* win32/gwinhttpfileinputstream.c
* win32/gwinhttpfileinputstream.h
* win32/gwinhttpfileoutputstream.c
* win32/gwinhttpfileoutputstream.h: New files implementing
GWinHttpVfs and related classes, a GVfs for HTTP and HTTPS URIs on
Windows. The implementation uses the WinHttp API. Both reading and
writing are supported, i.e. GET and PUT requests. When writing,
each write call is done using a separate PUT request with a
Content-Range header. Requests for file URIs and plain pathnames
are forwarded to GLocalVfs.
* win32/winhttp.h: Reverse engineered <winhttp.h>, borrowed from
WINE. Used as there is no <winhttp.h> bundled with mingw, and
requiring people to download the Windows SDK just for this one
header is not reasonable.
* win32/Makefile.am: Add above files.
* giomodule.c: Call _g_winhttp_vfs_get_type() on Windows to set up
the plumbing for the above.
svn path=/trunk/; revision=7344
2008-08-12 Federico Mena Quintero <federico@novell.com>
* glib/gi18n-lib.h: In the #error about having to define
GETTEXT_PACKAGE, add a hint about a possibly-missing config.h.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=7343