projects
/
platform
/
upstream
/
glib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
glib/tests/mainloop: Acquire the context while asserting its state
[platform/upstream/glib.git]
/
glib
/
gwakeup.c
diff --git
a/glib/gwakeup.c
b/glib/gwakeup.c
index
2aec2f5
..
c0f1ba0
100644
(file)
--- 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
* 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 <http://www.gnu.org/licenses/>.
*
* Author: Ryan Lortie <desrt@desrt.ca>
*/
*
* Author: Ryan Lortie <desrt@desrt.ca>
*/
@@
-229,19
+227,26
@@
g_wakeup_acknowledge (GWakeup *wakeup)
void
g_wakeup_signal (GWakeup *wakeup)
{
void
g_wakeup_signal (GWakeup *wakeup)
{
- guint64 one = 1;
int res;
if (wakeup->fds[1] == -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
{
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
do
- res = write (wakeup->fds[1], &one,
1
);
+ res = write (wakeup->fds[1], &one,
sizeof one
);
while (G_UNLIKELY (res == -1 && errno == EINTR));
}
}
while (G_UNLIKELY (res == -1 && errno == EINTR));
}
}