aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/err.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/err.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/err.cpp')
-rw-r--r--util/system/err.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/util/system/err.cpp b/util/system/err.cpp
index 5573ea1ee9..9580d7ad5c 100644
--- a/util/system/err.cpp
+++ b/util/system/err.cpp
@@ -1,79 +1,79 @@
#include "defaults.h"
-#include "progname.h"
-#include "compat.h"
-#include "error.h"
+#include "progname.h"
+#include "compat.h"
+#include "error.h"
-#include <util/generic/scope.h>
+#include <util/generic/scope.h>
-#include <util/stream/printf.h>
-#include <util/stream/output.h>
+#include <util/stream/printf.h>
+#include <util/stream/output.h>
-void vwarnx(const char* fmt, va_list args) {
- Cerr << GetProgramName() << ": ";
+void vwarnx(const char* fmt, va_list args) {
+ Cerr << GetProgramName() << ": ";
- if (fmt) {
- Printf(Cerr, fmt, args);
- }
+ if (fmt) {
+ Printf(Cerr, fmt, args);
+ }
- Cerr << '\n';
-}
-
-void vwarn(const char* fmt, va_list args) {
- int curErrNo = errno;
- auto curErrText = LastSystemErrorText();
+ Cerr << '\n';
+}
- Y_DEFER {
- errno = curErrNo;
- };
+void vwarn(const char* fmt, va_list args) {
+ int curErrNo = errno;
+ auto curErrText = LastSystemErrorText();
- Cerr << GetProgramName() << ": ";
+ Y_DEFER {
+ errno = curErrNo;
+ };
- if (fmt) {
- Printf(Cerr, fmt, args);
- Cerr << ": ";
- }
+ Cerr << GetProgramName() << ": ";
- Cerr << curErrText << '\n';
+ if (fmt) {
+ Printf(Cerr, fmt, args);
+ Cerr << ": ";
+ }
+
+ Cerr << curErrText << '\n';
}
-void warn(const char* fmt, ...) {
- va_list args;
+void warn(const char* fmt, ...) {
+ va_list args;
- va_start(args, fmt);
- vwarn(fmt, args);
- va_end(args);
+ va_start(args, fmt);
+ vwarn(fmt, args);
+ va_end(args);
}
-void warnx(const char* fmt, ...) {
- va_list args;
+void warnx(const char* fmt, ...) {
+ va_list args;
- va_start(args, fmt);
- vwarnx(fmt, args);
- va_end(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 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 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 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);
+void errx(int status, const char* fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ verrx(status, fmt, args);
+ va_end(args);
}