aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-07-19 03:49:33 -0700
committerAdam Joseph <adam@westernsemico.com>2022-07-19 03:49:33 -0700
commita9e75eca00f7efe361545c6e77ecb65244230dc3 (patch)
treec407aff3c3dd5ad050f34340472839b592dfee42 /src/libutil
parent99fcc91f67ece5a9646065665395f496d6a0cb84 (diff)
error.hh: add additional constructor with explicit errno argument
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/error.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh
index a53e9802e..3d1479c54 100644
--- a/src/libutil/error.hh
+++ b/src/libutil/error.hh
@@ -204,13 +204,19 @@ public:
int errNo;
template<typename... Args>
- SysError(const Args & ... args)
+ SysError(int errNo_, const Args & ... args)
: Error("")
{
- errNo = errno;
+ errNo = errNo_;
auto hf = hintfmt(args...);
err.msg = hintfmt("%1%: %2%", normaltxt(hf.str()), strerror(errNo));
}
+
+ template<typename... Args>
+ SysError(const Args & ... args)
+ : SysError(errno, args ...)
+ {
+ }
};
}