[glibmm] Gio::Pollable[Input|Output]Stream: Return -1 on error in vfuncs



commit 8b1ed0c3aa9ee79a69d08888de57f32254245e9b
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu Jun 2 09:02:25 2016 +0200

    Gio::Pollable[Input|Output]Stream: Return -1 on error in vfuncs
    
    * gio/src/pollableinputstream.hg: read_nonblocking_vfunc_callback():
    Return -1 if the C++ vfunc throws an exception.
    * gio/src/pollableoutputstream.hg: write_nonblocking_vfunc_callback():
    Return -1 if the C++ vfunc throws an exception.
    This is what the glib/gio functions expect, and the behaviour suggested in
    bug 572471 for similar vfuncs in other stream classes.

 gio/src/pollableinputstream.hg  |    4 +---
 gio/src/pollableoutputstream.hg |    4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gio/src/pollableinputstream.hg b/gio/src/pollableinputstream.hg
index ce4af17..b1c3178 100644
--- a/gio/src/pollableinputstream.hg
+++ b/gio/src/pollableinputstream.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2012 The giomm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -59,7 +57,7 @@ public:
 
   //TODO: _WRAP_VFUNC(Glib::RefPtr<Source> create_source(const Glib::RefPtr<Cancellable>& cancellable), 
"create_source")
 
-  _WRAP_VFUNC(gssize read_nonblocking(void* buffer, gsize count), "read_nonblocking", errthrow)
+  _WRAP_VFUNC(gssize read_nonblocking(void* buffer, gsize count), "read_nonblocking", errthrow, 
err_return_value -1)
 };
 
 } // namespace Gio
diff --git a/gio/src/pollableoutputstream.hg b/gio/src/pollableoutputstream.hg
index c6807c5..c735fc6 100644
--- a/gio/src/pollableoutputstream.hg
+++ b/gio/src/pollableoutputstream.hg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
 /* Copyright (C) 2012 The giomm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -60,7 +58,7 @@ public:
 
   //TODO:_WRAP_VFUNC(Glib::RefPtr<Source> create_source(const Glib::RefPtr<Cancellable>& cancellable), 
"create_source")
 
-  _WRAP_VFUNC(gssize write_nonblocking(const void* buffer, gsize count), "write_nonblocking", errthrow)
+  _WRAP_VFUNC(gssize write_nonblocking(const void* buffer, gsize count), "write_nonblocking", errthrow, 
err_return_value -1)
 };
 
 } // namespace Gio


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]