Skip to content
Snippets Groups Projects
Commit 05a14864 authored by Moe Jette's avatar Moe Jette
Browse files

revert a hostname change

parent c0cb1750
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ documents those changes that are of interest to users and admins. ...@@ -17,6 +17,7 @@ documents those changes that are of interest to users and admins.
no job memory limit specified (--mem). Also see DefMemPerTask and no job memory limit specified (--mem). Also see DefMemPerTask and
MaxMemPerTask in "man slurm.conf". Enforcement is dependent upon job MaxMemPerTask in "man slurm.conf". Enforcement is dependent upon job
accounting being enabled with non-zero value for JoabAcctGatherFrequency. accounting being enabled with non-zero value for JoabAcctGatherFrequency.
-- Change default node tmp_disk size to zero (for diskless nodes).
* Changes in SLURM 1.3.0-pre8 * Changes in SLURM 1.3.0-pre8
============================= =============================
......
...@@ -42,15 +42,14 @@ ...@@ -42,15 +42,14 @@
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <pthread.h>
#include <pwd.h> #include <pwd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/utsname.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h>
#include <slurm/slurm.h> #include <slurm/slurm.h>
...@@ -1011,18 +1010,27 @@ extern int slurm_conf_get_cpus_sct(const char *node_name, ...@@ -1011,18 +1010,27 @@ extern int slurm_conf_get_cpus_sct(const char *node_name,
* (e.g. "linux123.foo.bar" becomes "linux123") * (e.g. "linux123.foo.bar" becomes "linux123")
* OUT name * OUT name
*/ */
extern int int
gethostname_short (char *name, size_t len) gethostname_short (char *name, size_t len)
{ {
struct utsname buf; int error_code, name_len;
char *dot_ptr, path_name[1024];
if (uname(&buf)) error_code = gethostname (path_name, sizeof(path_name));
return errno; if (error_code)
return error_code;
dot_ptr = strchr (path_name, '.');
if (dot_ptr == NULL)
dot_ptr = path_name + strlen(path_name);
else
dot_ptr[0] = '\0';
if (strlen(buf.nodename) >= len) name_len = (dot_ptr - path_name);
if (name_len > len)
return ENAMETOOLONG; return ENAMETOOLONG;
strcpy(name, buf.nodename); strcpy (name, path_name);
return 0; return 0;
} }
......
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