summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-18 09:01:43 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2013-01-18 09:11:40 +0100
commitd16ee17c08a383b77070f3ba40d91882c0cb56e8 (patch)
treebc4c7622fa5afb2d70871cd7ecff30ecd0b8c4b3 /tools
parentc1fd3ca2b91b675c038816076f671e778907d9ce (diff)
downloadmsitools-d16ee17c08a383b77070f3ba40d91882c0cb56e8.tar.gz
msitools-d16ee17c08a383b77070f3ba40d91882c0cb56e8.tar.xz
msitools-d16ee17c08a383b77070f3ba40d91882c0cb56e8.zip
wixl: remove gio-unix dependency
It is not available under Windows, but it can be easily implemented using Posix.read.
Diffstat (limited to 'tools')
-rw-r--r--tools/wixl/util.vala16
-rw-r--r--tools/wixl/wixl-heat.vala2
2 files changed, 17 insertions, 1 deletions
diff --git a/tools/wixl/util.vala b/tools/wixl/util.vala
index e7fadcc..13269c7 100644
--- a/tools/wixl/util.vala
+++ b/tools/wixl/util.vala
@@ -143,4 +143,20 @@ namespace Wixl {
return -1;
}
+
+ public class UnixInputStream : GLib.InputStream {
+ public int fd { get; set construct; }
+
+ public UnixInputStream(int fd_) {
+ fd = fd_;
+ }
+
+ public override ssize_t read ([CCode (array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.IOError {
+ return Posix.read(fd, buffer, buffer.length);
+ }
+
+ public override bool close(GLib.Cancellable? cancellable = null) throws GLib.IOError {
+ return true;
+ }
+ }
} // Wixl
diff --git a/tools/wixl/wixl-heat.vala b/tools/wixl/wixl-heat.vala
index 560367d..44989c2 100644
--- a/tools/wixl/wixl-heat.vala
+++ b/tools/wixl/wixl-heat.vala
@@ -61,7 +61,7 @@ public int main (string[] args) {
var indent = " ";
try {
- var dis = new DataInputStream (new UnixInputStream (0, false));
+ var dis = new DataInputStream (new UnixInputStream (0));
string line;
while ((line = dis.read_line (null)) != null) {