diff options
author | Adam Joseph <adam@westernsemico.com> | 2022-07-19 03:49:33 -0700 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2022-07-19 03:49:33 -0700 |
commit | a9e75eca00f7efe361545c6e77ecb65244230dc3 (patch) | |
tree | c407aff3c3dd5ad050f34340472839b592dfee42 | |
parent | 99fcc91f67ece5a9646065665395f496d6a0cb84 (diff) |
error.hh: add additional constructor with explicit errno argument
-rw-r--r-- | src/libutil/error.hh | 10 |
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 ...) + { + } }; } |