2023-11-01 21:11:11 +00:00
|
|
|
// This file Copyright © Mnemosyne LLC.
|
2022-02-07 16:25:02 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2014-06-23 02:38:53 +00:00
|
|
|
|
2023-04-14 19:33:23 +00:00
|
|
|
#include "libtransmission/error.h"
|
|
|
|
#include "libtransmission/utils.h"
|
2014-06-23 02:38:53 +00:00
|
|
|
|
2023-11-04 16:39:41 +00:00
|
|
|
void tr_error::set_from_errno(int errnum)
|
2023-01-25 18:20:10 +00:00
|
|
|
{
|
2023-11-04 16:39:41 +00:00
|
|
|
code_ = errnum;
|
2014-06-23 02:38:53 +00:00
|
|
|
|
2023-11-04 16:39:41 +00:00
|
|
|
message_ = errnum != 0 ? tr_strerror(errnum) : "";
|
2014-06-23 02:38:53 +00:00
|
|
|
}
|