diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2013-11-04 16:32:01 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2013-11-04 22:55:30 +0800 |
commit | f4931142806556123ce75dcf8b84e60dc7cd4e3c (patch) | |
tree | d5ed8586fcd5459465d905b1547e61e4946783c2 /gio/tests/gsubprocess-testprog.c | |
parent | d262b6fe0ca851a47fede2e624cec4aa041f2f14 (diff) | |
download | glib-f4931142806556123ce75dcf8b84e60dc7cd4e3c.tar.gz glib-f4931142806556123ce75dcf8b84e60dc7cd4e3c.tar.bz2 glib-f4931142806556123ce75dcf8b84e60dc7cd4e3c.zip |
gio/tests: Clean up inclusion of unistd.h
Include unistd.h only on *NIX and define items as necessary on Windows,
also replace instances of ssize_t with the GLib-equivilant gssize so to fix
the build on platforms that do not have ssize_t, such as Visual C++.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
Diffstat (limited to 'gio/tests/gsubprocess-testprog.c')
-rw-r--r-- | gio/tests/gsubprocess-testprog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gio/tests/gsubprocess-testprog.c b/gio/tests/gsubprocess-testprog.c index 1e5a94821..df865f626 100644 --- a/gio/tests/gsubprocess-testprog.c +++ b/gio/tests/gsubprocess-testprog.c @@ -3,8 +3,8 @@ #include <stdio.h> #include <stdlib.h> #include <errno.h> -#include <unistd.h> #ifdef G_OS_UNIX +#include <unistd.h> #include <gio/gunixinputstream.h> #include <gio/gunixoutputstream.h> #endif @@ -20,7 +20,7 @@ write_all (int fd, { while (len > 0) { - ssize_t bytes_written = write (fd, buf, len); + gssize bytes_written = write (fd, buf, len); if (bytes_written < 0) g_error ("Failed to write to fd %d: %s", fd, strerror (errno)); |