diff --git a/log/log.c b/log/log.c index 8be1397..ac7c0df 100644 --- a/log/log.c +++ b/log/log.c @@ -51,6 +51,7 @@ #include #endif +#include "../net/sock.h" #include "log.h" #define LOG_MAXLOGS 25 @@ -610,6 +611,17 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap) arg = buf; } /* fall through */ + case 'R': + if (!arg) { + sock_t sock = va_arg(ap, sock_t); + if (sock == SOCK_ERROR) { + snprintf(buf, sizeof(buf), "SOCK_ERROR"); + } else { + snprintf(buf, sizeof(buf), "%lli", (long long int)sock); + } + arg = buf; + } + /* fall through */ case 's': case 'H': // TODO.