Skip to content
Snippets Groups Projects
Commit 9f2b3ffe authored by Danny Auble's avatar Danny Auble
Browse files

Fix test to print out the slurmd node name instead of gethostname so

it works better on multi-slurmd installs.
parent 2e833147
No related branches found
No related tags found
No related merge requests found
...@@ -2,17 +2,19 @@ ...@@ -2,17 +2,19 @@
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
int main (int ac, char **av) int main (int ac, char **av)
{ {
char hostname[1024]; char *hostname = NULL;
int i, rc = 0; int i, rc = 0;
struct sigaction act; struct sigaction act;
if (gethostname (hostname, sizeof (hostname)) < 0) { if (!(hostname = getenv("SLURMD_NODENAME"))) {
fprintf (stderr, "Failed to get hostname on this node\n"); fprintf (stderr, "Failed to get hostname on this node\n");
strcpy (hostname, "Unknown"); hostname = "Unknown";
} }
for (i = 1; i < SIGRTMAX; i++) { for (i = 1; i < SIGRTMAX; i++) {
sigaction (i, NULL, &act); sigaction (i, NULL, &act);
if (act.sa_handler == SIG_IGN) { if (act.sa_handler == SIG_IGN) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment