2023-11-01 22:11:11 +01:00
|
|
|
// This file Copyright © Mnemosyne LLC.
|
2022-02-07 10:25:02 -06:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 12:27:56 -06: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 14:33:23 -05:00
|
|
|
#include "libtransmission/error.h"
|
|
|
|
#include "libtransmission/utils.h"
|
2014-06-23 02:38:53 +00:00
|
|
|
|
2023-11-04 11:39:41 -05:00
|
|
|
void tr_error::set_from_errno(int errnum)
|
2023-01-25 12:20:10 -06:00
|
|
|
{
|
2023-11-04 11:39:41 -05:00
|
|
|
code_ = errnum;
|
2014-06-23 02:38:53 +00:00
|
|
|
|
2023-11-04 11:39:41 -05:00
|
|
|
message_ = errnum != 0 ? tr_strerror(errnum) : "";
|
2014-06-23 02:38:53 +00:00
|
|
|
}
|