ports/sysutils/slurm-wlm/files/patch-src_scrun_anchor.c
Thierry Thomas 9adb7c18c4 sysutils/slurm-wlm: upgrade to 23.11.1
Releases notes at <https://www.schedmd.com/news.php>.

Remark: MySQL is no more an option.

Security:	CVE-2023-49933 through CVE-2023-49938
Differential Revision:	<https://reviews.freebsd.org/D42764>
2023-12-18 22:26:58 +01:00

27 lines
700 B
C

--- src/scrun/anchor.c.orig 2023-11-21 22:33:29 UTC
+++ src/scrun/anchor.c
@@ -43,7 +43,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h>
+#ifdef __FreeBSD__
+#include <pthread_np.h>
+#include <sys/signal.h>
+#else
#include <sys/prctl.h>
+#endif
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -1034,7 +1039,11 @@ static void _set_proctitle()
setproctitle("%s", state.id);
xstrfmtcat(thread_name, "scrun:%s", state.id);
+#ifdef __FreeBSD__
+ if (pthread_setname_np(pthread_self(), thread_name) < 0) {
+#else
if (prctl(PR_SET_NAME, thread_name, NULL, NULL, NULL) < 0) {
+#endif
fatal("Unable to set process name");
}
xfree(thread_name);