Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
1e54c1f0
Commit
1e54c1f0
authored
22 years ago
by
Marcus Meissner
Committed by
Alexandre Julliard
22 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented FlushFileBuffers for serial devices.
parent
a7b2bf48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/serial.c
+17
-2
17 additions, 2 deletions
server/serial.c
with
17 additions
and
2 deletions
server/serial.c
+
17
−
2
View file @
1e54c1f0
...
...
@@ -55,6 +55,7 @@ static int serial_get_poll_events( struct object *obj );
static
void
serial_queue_async
(
struct
object
*
obj
,
void
*
ptr
,
unsigned
int
status
,
int
type
,
int
count
);
static
void
destroy_serial
(
struct
object
*
obj
);
static
void
serial_poll_event
(
struct
object
*
obj
,
int
event
);
static
int
serial_flush
(
struct
object
*
obj
);
struct
serial
{
...
...
@@ -92,7 +93,7 @@ static const struct object_ops serial_ops =
serial_get_poll_events
,
/* get_poll_events */
serial_poll_event
,
/* poll_event */
serial_get_fd
,
/* get_fd */
no
_flush
,
/* flush */
serial
_flush
,
/* flush */
serial_get_info
,
/* get_file_info */
serial_queue_async
,
/* queue_async */
destroy_serial
/* destroy */
...
...
@@ -316,6 +317,21 @@ static void serial_queue_async(struct object *obj, void *ptr, unsigned int statu
set_select_events
(
obj
,
serial_get_poll_events
(
obj
));
}
static
int
serial_flush
(
struct
object
*
obj
)
{
int
ret
;
struct
serial
*
serial
=
(
struct
serial
*
)
grab_object
(
obj
);
assert
(
obj
->
ops
==
&
serial_ops
);
/* MSDN says: If hFile is a handle to a communications device,
* the function only flushes the transmit buffer.
*/
ret
=
(
tcflush
(
serial
->
obj
.
fd
,
TCOFLUSH
)
!=
-
1
);
if
(
!
ret
)
file_set_error
();
release_object
(
serial
);
return
ret
;
}
/* create a serial */
DECL_HANDLER
(
create_serial
)
{
...
...
@@ -391,4 +407,3 @@ DECL_HANDLER(set_serial_info)
release_object
(
serial
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment