summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
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) {