[Rpm-maint] [rpm-software-management/rpm] Add rpmlogOnce() and rpmlogReset() (PR #3417)

Florian Festi notifications at github.com
Thu Oct 31 09:08:04 UTC 2024


@ffesti commented on this pull request.



> @@ -412,3 +415,43 @@ void rpmlog (int code, const char *fmt, ...)
 exit:
     errno = saved_errno;
 }
+
+int rpmlogOnce (uint64_t domain, const char * key, int code, const char *fmt, ...)
+{
+    int saved_errno = errno;
+    rpmlogCtx ctx = rpmlogCtxAcquire();
+    int newkey = 0;
+
+    if (ctx) {
+	wrlock lock(ctx->mutex);
+	newkey = !ctx->seen[domain][{code, key}]++;

Yeah this needs a comment. Is `/* This gets initialized automatically on first access */` clear enough?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3417#discussion_r1824114894
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3417/review/2407419438 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241031/265b145f/attachment-0001.html>


More information about the Rpm-maint mailing list