Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153667269
D48648.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48648.diff
View Options
diff --git a/lib/libiscsiutil/libiscsiutil.h b/lib/libiscsiutil/libiscsiutil.h
--- a/lib/libiscsiutil/libiscsiutil.h
+++ b/lib/libiscsiutil/libiscsiutil.h
@@ -162,9 +162,13 @@
void log_set_peer_addr(const char *addr);
void log_err(int, const char *, ...)
__dead2 __printflike(2, 3);
+void log_errc(int, int, const char *, ...)
+ __dead2 __printflike(3, 4);
void log_errx(int, const char *, ...)
__dead2 __printflike(2, 3);
void log_warn(const char *, ...) __printflike(1, 2);
+void log_warnc(int, const char *, ...)
+ __printflike(2, 3);
void log_warnx(const char *, ...) __printflike(1, 2);
void log_debugx(const char *, ...) __printflike(1, 2);
diff --git a/lib/libiscsiutil/log.c b/lib/libiscsiutil/log.c
--- a/lib/libiscsiutil/log.c
+++ b/lib/libiscsiutil/log.c
@@ -152,6 +152,18 @@
exit(eval);
}
+void
+log_errc(int eval, int code, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ log_common(LOG_CRIT, code, fmt, ap);
+ va_end(ap);
+
+ exit(eval);
+}
+
void
log_errx(int eval, const char *fmt, ...)
{
@@ -174,6 +186,16 @@
va_end(ap);
}
+void
+log_warnc(int code, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ log_common(LOG_WARNING, code, fmt, ap);
+ va_end(ap);
+}
+
void
log_warnx(const char *fmt, ...)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 23, 7:00 PM (6 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32039542
Default Alt Text
D48648.diff (1 KB)
Attached To
Mode
D48648: libiscsiutil: Add log_warnc() and log_errc() functions
Attached
Detach File
Event Timeline
Log In to Comment