diff options
author | Vincent Ambo <mail@tazj.in> | 2021-09-21T10·03+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-09-21T11·29+0300 |
commit | 43b1791ec601732ac31195df96781a848360a9ac (patch) | |
tree | daae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/compat/win32/syslog.c | |
parent | 2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff) |
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping it in sync with cgit would be easier this way, but it has proven not to be a big issue. On the other hand, a vendored copy of git is an annoying maintenance burden. It is much easier to rebase the single (dottime) patch that we have. This removes the vendored copy of git and instead passes the git source code to cgit via `pkgs.srcOnly`, which includes the applied patch so that cgit can continue rendering dottime. Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/compat/win32/syslog.c')
-rw-r--r-- | third_party/git/compat/win32/syslog.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/third_party/git/compat/win32/syslog.c b/third_party/git/compat/win32/syslog.c deleted file mode 100644 index 161978d720ae..000000000000 --- a/third_party/git/compat/win32/syslog.c +++ /dev/null @@ -1,80 +0,0 @@ -#include "../../git-compat-util.h" - -static HANDLE ms_eventlog; - -void openlog(const char *ident, int logopt, int facility) -{ - if (ms_eventlog) - return; - - ms_eventlog = RegisterEventSourceA(NULL, ident); - - if (!ms_eventlog) - warning("RegisterEventSource() failed: %lu", GetLastError()); -} - -void syslog(int priority, const char *fmt, ...) -{ - WORD logtype; - char *str, *pos; - int str_len; - va_list ap; - - if (!ms_eventlog) - return; - - va_start(ap, fmt); - str_len = vsnprintf(NULL, 0, fmt, ap); - va_end(ap); - - if (str_len < 0) { - warning_errno("vsnprintf failed"); - return; - } - - str = malloc(st_add(str_len, 1)); - if (!str) { - warning_errno("malloc failed"); - return; - } - - va_start(ap, fmt); - vsnprintf(str, str_len + 1, fmt, ap); - va_end(ap); - - while ((pos = strstr(str, "%1")) != NULL) { - char *oldstr = str; - str = realloc(str, st_add(++str_len, 1)); - if (!str) { - free(oldstr); - warning_errno("realloc failed"); - return; - } - memmove(pos + 2, pos + 1, strlen(pos)); - pos[1] = ' '; - } - - switch (priority) { - case LOG_EMERG: - case LOG_ALERT: - case LOG_CRIT: - case LOG_ERR: - logtype = EVENTLOG_ERROR_TYPE; - break; - - case LOG_WARNING: - logtype = EVENTLOG_WARNING_TYPE; - break; - - case LOG_NOTICE: - case LOG_INFO: - case LOG_DEBUG: - default: - logtype = EVENTLOG_INFORMATION_TYPE; - break; - } - - ReportEventA(ms_eventlog, logtype, 0, 0, NULL, 1, 0, - (const char **)&str, NULL); - free(str); -} |