summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-03-14 06:48:34 +0000
committerPo Lu <luangruo@yahoo.com>2022-03-14 06:48:53 +0000
commita1fa3d24d7f96542530f30c28daf9bf8aaaeae13 (patch)
tree49da62e68b1ab8303b53966a1f73645268275d9a /src
parent1a07854e0e8825da1d1acfc1701eb30787546ee5 (diff)
downloademacs-a1fa3d24d7f96542530f30c28daf9bf8aaaeae13.tar.gz
Clean up some Haiku toolkit code
* src/haiku_io.c (haiku_read_with_timeout): Accept `bigtime_t' instead of `time_t' for values which are cast to bigtime_t anyway. * src/haiku_support.cc (BMenu_run): Read all help events instead of just one. * src/haiku_support.h: Update prototypes.
Diffstat (limited to 'src')
-rw-r--r--src/haiku_io.c2
-rw-r--r--src/haiku_support.cc2
-rw-r--r--src/haiku_support.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/haiku_io.c b/src/haiku_io.c
index ff684df4337..f9fa4095f9f 100644
--- a/src/haiku_io.c
+++ b/src/haiku_io.c
@@ -145,7 +145,7 @@ haiku_read (enum haiku_event_type *type, void *buf, ssize_t len)
Input is blocked when an attempt to read is in progress. */
int
haiku_read_with_timeout (enum haiku_event_type *type, void *buf, ssize_t len,
- time_t timeout, bool popup_menu_p)
+ bigtime_t timeout, bool popup_menu_p)
{
int32 typ;
port_id from = (popup_menu_p
diff --git a/src/haiku_support.cc b/src/haiku_support.cc
index cb8ffaf2d7b..27d4bbafaf7 100644
--- a/src/haiku_support.cc
+++ b/src/haiku_support.cc
@@ -2957,7 +2957,7 @@ BMenu_run (void *menu, int x, int y,
if (infos[0].events & B_EVENT_READ)
{
- if (!haiku_read_with_timeout (&type, buf, 200, 1000000, true))
+ while (!haiku_read_with_timeout (&type, buf, 200, 0, true))
{
switch (type)
{
diff --git a/src/haiku_support.h b/src/haiku_support.h
index 8b21fafad73..41bd1e1c84f 100644
--- a/src/haiku_support.h
+++ b/src/haiku_support.h
@@ -420,7 +420,7 @@ extern "C"
extern int
haiku_read_with_timeout (enum haiku_event_type *type, void *buf, ssize_t len,
- time_t timeout, bool popup_menu_p);
+ bigtime_t timeout, bool popup_menu_p);
extern int
haiku_write (enum haiku_event_type type, void *buf);