[Rpm-maint] [rpm-software-management/rpm] AIX: revert xsetprogname and xgetprogname (PR #4056)

Panu Matilainen notifications at github.com
Tue Dec 2 09:59:16 UTC 2025


@pmatilai commented on this pull request.



> +
+void rsetprogname(const char *pn)
+{
+#if defined(HAVE_SETPROGNAME) /* BSD'ish systems */
+    setprogname(pn);
+#elif defined(HAVE___PROGNAME) /* glibc and others */
+#else /* AIX systems */
+    if (pn != NULL && rprogname == NULL /* set the value only once */) {
+	const char *p = strrchr(pn, '/'); /* locate the last occurrence of '/' */
+	if (p != NULL)
+	    rprogname = p + 1 /* strip beginning '/' */;
+	else
+	    rprogname = pn;
+    }
+#endif
+}

I'd avoid rpmio.cc for these, it's one of the bigger sources in rpmio/ as it is and these don't really relate to that stuff at all. rgetopt.cc would be probably the closest match in terms of context, but .. since it doesn't seem to be a good fit to any existing source, lets just put it into a source of its own (progname.cc or so). Doesn't cost us anything. 

Other than that, this looks much much nicer than the existing system.h mess :+1: 

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

Message ID: <rpm-software-management/rpm/pull/4056/review/3529237680 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20251202/2c10efd3/attachment.htm>


More information about the Rpm-maint mailing list