From a94017c7311ae80f830d02126aac59e747aff2fc Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Wed, 11 Aug 2021 19:10:30 +0200 Subject: [PATCH] Remove sendto_ops_and_log(), use unreal_log() instead! --- include/h.h | 1 - src/send.c | 17 ----------------- src/serv.c | 3 ++- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/include/h.h b/include/h.h index 28377e1f8..569b554c2 100644 --- a/include/h.h +++ b/include/h.h @@ -268,7 +268,6 @@ extern void sendnotice(Client *to, FORMAT_STRING(const char *pattern), ...) __at extern void sendnumeric(Client *to, int numeric, ...); extern void sendnumericfmt(Client *to, int numeric, FORMAT_STRING(const char *pattern), ...) __attribute__((format(printf,3,4))); extern void sendto_server(Client *one, unsigned long caps, unsigned long nocaps, MessageTag *mtags, FORMAT_STRING(const char *format), ...) __attribute__((format(printf, 5, 6))); -extern void sendto_ops_and_log(FORMAT_STRING(const char *pattern), ...) __attribute__((format(printf,1,2))); extern MODVAR int writecalls, writeb[]; extern int deliver_it(Client *cptr, char *str, int len, int *want_read); diff --git a/src/send.c b/src/send.c index c5fbb0cff..ae6deef3e 100644 --- a/src/send.c +++ b/src/send.c @@ -782,23 +782,6 @@ void sendto_realops(FORMAT_STRING(const char *pattern), ...) } } -/** Send a message to all locally connected IRCOps and also log the error. - * @param pattern The format string / pattern to use. - * @param ... Format string parameters. - */ -void sendto_ops_and_log(FORMAT_STRING(const char *pattern), ...) -{ - va_list vl; - char buf[1024]; - - va_start(vl, pattern); - ircvsnprintf(buf, sizeof(buf), pattern, vl); - va_end(vl); - - sendto_umode(UMODE_OPER, "%s", buf); - unreal_log_raw(ULOG_ERROR, "unknown", "UNKNOWN", NULL, buf); -} - /** Send a message to all locally connected users with specified user mode. * @param umodes The umode that the recipient should have set (one of UMODE_) * @param pattern The format string / pattern to use. diff --git a/src/serv.c b/src/serv.c index 5d355e389..375c4d4c2 100644 --- a/src/serv.c +++ b/src/serv.c @@ -1332,7 +1332,8 @@ void start_server_handshake(Client *client) if (!aconf) { /* Should be impossible. */ - sendto_ops_and_log("Lost configuration for %s in start_server_handshake()", get_client_name(client, FALSE)); + unreal_log(LOG_ERROR, "link", "BUG_LOST_CONFIGURATION_ON_HANDSHAKE", client, + "Lost configuration while connecting to $client.details"); return; }