Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
actor-incubator
Commits
4ab6c8b2
Commit
4ab6c8b2
authored
Jul 10, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using errno directly
parent
f275eb52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
libcaf_net/src/network_socket.cpp
libcaf_net/src/network_socket.cpp
+2
-2
libcaf_net/src/pipe_socket.cpp
libcaf_net/src/pipe_socket.cpp
+2
-2
No files found.
libcaf_net/src/network_socket.cpp
View file @
4ab6c8b2
...
@@ -242,7 +242,7 @@ variant<size_t, std::errc> write(network_socket x, const void* buf,
...
@@ -242,7 +242,7 @@ variant<size_t, std::errc> write(network_socket x, const void* buf,
auto
res
=
::
send
(
x
.
id
,
reinterpret_cast
<
socket_send_ptr
>
(
buf
),
buf_size
,
auto
res
=
::
send
(
x
.
id
,
reinterpret_cast
<
socket_send_ptr
>
(
buf
),
buf_size
,
no_sigpipe_io_flag
);
no_sigpipe_io_flag
);
if
(
res
<
0
)
if
(
res
<
0
)
return
static_cast
<
std
::
errc
>
(
errno
);
return
static_cast
<
std
::
errc
>
(
last_socket_error
()
);
return
static_cast
<
size_t
>
(
res
);
return
static_cast
<
size_t
>
(
res
);
}
}
...
@@ -250,7 +250,7 @@ variant<size_t, std::errc> read(network_socket x, void* buf, size_t buf_size) {
...
@@ -250,7 +250,7 @@ variant<size_t, std::errc> read(network_socket x, void* buf, size_t buf_size) {
auto
res
=
::
recv
(
x
.
id
,
reinterpret_cast
<
socket_recv_ptr
>
(
buf
),
buf_size
,
auto
res
=
::
recv
(
x
.
id
,
reinterpret_cast
<
socket_recv_ptr
>
(
buf
),
buf_size
,
no_sigpipe_io_flag
);
no_sigpipe_io_flag
);
if
(
res
<
0
)
if
(
res
<
0
)
return
static_cast
<
std
::
errc
>
(
errno
);
return
static_cast
<
std
::
errc
>
(
last_socket_error
()
);
return
static_cast
<
size_t
>
(
res
);
return
static_cast
<
size_t
>
(
res
);
}
}
...
...
libcaf_net/src/pipe_socket.cpp
View file @
4ab6c8b2
...
@@ -85,14 +85,14 @@ variant<size_t, std::errc> write(pipe_socket x, const void* buf,
...
@@ -85,14 +85,14 @@ variant<size_t, std::errc> write(pipe_socket x, const void* buf,
size_t
buf_size
)
{
size_t
buf_size
)
{
auto
res
=
::
write
(
x
.
id
,
buf
,
buf_size
);
auto
res
=
::
write
(
x
.
id
,
buf
,
buf_size
);
if
(
res
<
0
)
if
(
res
<
0
)
return
static_cast
<
std
::
errc
>
(
errno
);
return
static_cast
<
std
::
errc
>
(
last_socket_error
()
);
return
static_cast
<
size_t
>
(
res
);
return
static_cast
<
size_t
>
(
res
);
}
}
variant
<
size_t
,
std
::
errc
>
read
(
pipe_socket
x
,
void
*
buf
,
size_t
buf_size
)
{
variant
<
size_t
,
std
::
errc
>
read
(
pipe_socket
x
,
void
*
buf
,
size_t
buf_size
)
{
auto
res
=
::
read
(
x
.
id
,
buf
,
buf_size
);
auto
res
=
::
read
(
x
.
id
,
buf
,
buf_size
);
if
(
res
<
0
)
if
(
res
<
0
)
return
static_cast
<
std
::
errc
>
(
errno
);
return
static_cast
<
std
::
errc
>
(
last_socket_error
()
);
return
static_cast
<
size_t
>
(
res
);
return
static_cast
<
size_t
>
(
res
);
}
}
...
...
Write
Preview
Markdown
is supported
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