X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=glib%2Fgwakeup.c;h=c0f1ba0541ad361bfe378797da4dc5d96cc5c234;hb=9f5afe3966d31ef6f1e880d950206a0325e6c777;hp=2aec2f59f1501395fe9dd6f59cedcb536d4ecb68;hpb=e3582c617cf00f3c90b6448d11cf253933a28802;p=platform%2Fupstream%2Fglib.git
diff --git a/glib/gwakeup.c b/glib/gwakeup.c
index 2aec2f5..c0f1ba0 100644
--- a/glib/gwakeup.c
+++ b/glib/gwakeup.c
@@ -12,9 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see .
*
* Author: Ryan Lortie
*/
@@ -229,19 +227,26 @@ g_wakeup_acknowledge (GWakeup *wakeup)
void
g_wakeup_signal (GWakeup *wakeup)
{
- guint64 one = 1;
int res;
if (wakeup->fds[1] == -1)
{
+ guint64 one = 1;
+
+ /* eventfd() case. It requires a 64-bit counter increment value to be
+ * written. */
do
res = write (wakeup->fds[0], &one, sizeof one);
while (G_UNLIKELY (res == -1 && errno == EINTR));
}
else
{
+ guint8 one = 1;
+
+ /* Non-eventfd() case. Only a single byte needs to be written, and it can
+ * have an arbitrary value. */
do
- res = write (wakeup->fds[1], &one, 1);
+ res = write (wakeup->fds[1], &one, sizeof one);
while (G_UNLIKELY (res == -1 && errno == EINTR));
}
}