aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/err.cpp
diff options
context:
space:
mode:
authormelkov <melkov@yandex-team.ru>2022-02-10 16:48:14 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:14 +0300
commit2c532b38e6aeb4fd88531027c7335690fd34c4e5 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/err.cpp
parent438546c8737d5c1fdeb31157dcf999717d930eec (diff)
downloadydb-2c532b38e6aeb4fd88531027c7335690fd34c4e5.tar.gz
Restoring authorship annotation for <melkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/err.cpp')
-rw-r--r--util/system/err.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/util/system/err.cpp b/util/system/err.cpp
index 891d7c0cb6..5573ea1ee9 100644
--- a/util/system/err.cpp
+++ b/util/system/err.cpp
@@ -4,20 +4,20 @@
#include "error.h"
#include <util/generic/scope.h>
-
+
#include <util/stream/printf.h>
#include <util/stream/output.h>
-
+
void vwarnx(const char* fmt, va_list args) {
Cerr << GetProgramName() << ": ";
-
+
if (fmt) {
Printf(Cerr, fmt, args);
}
-
+
Cerr << '\n';
}
-
+
void vwarn(const char* fmt, va_list args) {
int curErrNo = errno;
auto curErrText = LastSystemErrorText();
@@ -25,55 +25,55 @@ void vwarn(const char* fmt, va_list args) {
Y_DEFER {
errno = curErrNo;
};
-
+
Cerr << GetProgramName() << ": ";
-
+
if (fmt) {
Printf(Cerr, fmt, args);
Cerr << ": ";
}
Cerr << curErrText << '\n';
-}
-
+}
+
void warn(const char* fmt, ...) {
va_list args;
-
+
va_start(args, fmt);
vwarn(fmt, args);
va_end(args);
-}
-
+}
+
void warnx(const char* fmt, ...) {
va_list args;
-
+
va_start(args, fmt);
vwarnx(fmt, args);
va_end(args);
-}
-
+}
+
void verr(int status, const char* fmt, va_list args) {
vwarn(fmt, args);
exit(status);
-}
-
+}
+
void err(int status, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
verr(status, fmt, args);
va_end(args);
-}
-
+}
+
void verrx(int status, const char* fmt, va_list args) {
vwarnx(fmt, args);
exit(status);
-}
-
+}
+
void errx(int status, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
verrx(status, fmt, args);
va_end(args);
-}
+}