diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-01-17 15:41:40 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-01-18 09:11:40 +0100 |
commit | c1fd3ca2b91b675c038816076f671e778907d9ce (patch) | |
tree | 179e3fc7788388731d4e7581e7452c4e94f022e7 /tools/msiinfo.c | |
parent | 75dcee9e8f66c18c25326fc636d98cf99b95f6d1 (diff) | |
download | msitools-c1fd3ca2b91b675c038816076f671e778907d9ce.tar.gz msitools-c1fd3ca2b91b675c038816076f671e778907d9ce.tar.xz msitools-c1fd3ca2b91b675c038816076f671e778907d9ce.zip |
msiinfo: remove gio-unix dependency
Everything builds now (wixl-heat is disabled), but msibuild
seems to be still broken on Win32.
Also, testdatabase and testsuminfo do not pass.
Diffstat (limited to 'tools/msiinfo.c')
-rw-r--r-- | tools/msiinfo.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/msiinfo.c b/tools/msiinfo.c index 55bf8ca..b68172b 100644 --- a/tools/msiinfo.c +++ b/tools/msiinfo.c @@ -372,11 +372,10 @@ static int cmd_extract(struct Command *cmd, int argc, char **argv, GError **erro LibmsiDatabase *db = NULL; LibmsiQuery *query = NULL; LibmsiRecord *rec = NULL; - GOutputStream *out = NULL; GInputStream *in = NULL; int r = 1; - char *buf; - unsigned size, bufsize; + char buffer[4096]; + size_t n_read, n_written; if (argc != 3) { cmd_usage(stderr, cmd); @@ -405,17 +404,21 @@ static int cmd_extract(struct Command *cmd, int argc, char **argv, GError **erro _setmode(STDOUT_FILENO, O_BINARY); #endif - out = g_unix_output_stream_new(STDOUT_FILENO, FALSE); in = G_INPUT_STREAM (libmsi_record_get_stream(rec, 1)); - if (g_output_stream_splice(out, in, 0, NULL, error) == -1) - goto end; + for (;;) { + n_read = g_input_stream_read (in, buffer, sizeof (buffer), NULL, error); + if (n_read == -1) + goto end; + if (n_read == 0) + break; + + full_write (STDOUT_FILENO, buffer, n_read); + } if (!*error) r = 0; end: - if (out) - g_object_unref(out); if (in) g_object_unref(in); if (rec) |