Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
7a43b102
Commit
7a43b102
authored
Nov 16, 1999
by
Niels Möller
Browse files
* src/io.c (write_raw_with_poll): Return an exception on error.
(write_raw): -"- Rev: src/io.c:1.81 Rev: src/io.h:1.49
parent
e7d6c183
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/io.c
View file @
7a43b102
...
...
@@ -861,8 +861,8 @@ int address_info2sockaddr_in(struct sockaddr_in *sin,
/* These functions are used by werror() and friends */
/* For fd:s in blocking mode. */
void
write_raw
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
,
struct
exception_handler
*
e
)
const
struct
exception
*
write_raw
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
)
{
while
(
length
)
{
...
...
@@ -875,19 +875,18 @@ void write_raw(int fd, UINT32 length, const UINT8 *data,
case
EAGAIN
:
continue
;
default:
EXCEPTION_RAISE
(
e
,
make_io_exception
(
EXC_IO_BLOCKING_WRITE
,
NULL
,
errno
,
NULL
));
return
;
return
make_io_exception
(
EXC_IO_BLOCKING_WRITE
,
NULL
,
errno
,
NULL
);
}
length
-=
written
;
data
+=
written
;
}
return
NULL
;
}
void
write_raw_with_poll
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
,
struct
exception_handler
*
e
)
const
struct
exception
*
write_raw_with_poll
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
)
{
while
(
length
)
{
...
...
@@ -907,8 +906,8 @@ void write_raw_with_poll(int fd, UINT32 length, const UINT8 *data,
case
EAGAIN
:
continue
;
default:
EXCEPTION_RAISE
(
e
,
make_io_exception
(
EXC_IO_BLOCKING_WRITE
,
NULL
,
errno
,
NULL
)
)
;
return
make_io_exception
(
EXC_IO_BLOCKING_WRITE
,
NULL
,
errno
,
NULL
);
}
written
=
write
(
fd
,
data
,
length
);
...
...
@@ -920,13 +919,14 @@ void write_raw_with_poll(int fd, UINT32 length, const UINT8 *data,
case
EAGAIN
:
continue
;
default:
EXCEPTION_RAISE
(
e
,
make_io_exception
(
EXC_IO_BLOCKING_WRITE
,
NULL
,
errno
,
NULL
)
)
;
return
make_io_exception
(
EXC_IO_BLOCKING_WRITE
,
NULL
,
errno
,
NULL
);
}
length
-=
written
;
data
+=
written
;
}
return
NULL
;
}
void
io_set_nonblocking
(
int
fd
)
...
...
src/io.h
View file @
7a43b102
...
...
@@ -313,10 +313,11 @@ struct address_info *sockaddr2info(size_t addr_len UNUSED,
int
address_info2sockaddr_in
(
struct
sockaddr_in
*
sin
,
struct
address_info
*
a
);
void
write_raw
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
,
struct
exception_handler
*
e
);
void
write_raw_with_poll
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
,
struct
exception_handler
*
e
);
/* Returns an exception, if anything went wrong */
const
struct
exception
*
write_raw
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
);
const
struct
exception
*
write_raw_with_poll
(
int
fd
,
UINT32
length
,
const
UINT8
*
data
);
void
io_set_nonblocking
(
int
fd
);
void
io_set_close_on_exec
(
int
fd
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment