mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Make fail() preserve the errno.
MFC after: 1 month Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
e19462c33b
commit
535bd9beaf
1 changed files with 5 additions and 1 deletions
|
|
@ -290,7 +290,9 @@ void
|
|||
fail(const struct connection *conn, const char *reason)
|
||||
{
|
||||
struct iscsi_daemon_fail idf;
|
||||
int error;
|
||||
int error, saved_errno;
|
||||
|
||||
saved_errno = errno;
|
||||
|
||||
memset(&idf, 0, sizeof(idf));
|
||||
idf.idf_session_id = conn->conn_session_id;
|
||||
|
|
@ -299,6 +301,8 @@ fail(const struct connection *conn, const char *reason)
|
|||
error = ioctl(conn->conn_iscsi_fd, ISCSIDFAIL, &idf);
|
||||
if (error != 0)
|
||||
log_err(1, "ISCSIDFAIL");
|
||||
|
||||
errno = saved_errno;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue