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

Remove logic to disable localtime_r() after a fork(), it is no longer

 needed thanks to slurmd_step functionality.
parent a5b4e5b0
No related branches found
No related tags found
No related merge requests found
...@@ -236,15 +236,4 @@ typedef enum {false, true} bool; ...@@ -236,15 +236,4 @@ typedef enum {false, true} bool;
# endif # endif
#endif #endif
/* localtime() can't be used after a fork due to possibly set semaphore.
* until we modify slurmd and srun to exec immediately after the fork,
* we disable localtime(). This is a temporary patch. */
#define DISABLE_LOCALTIME 1
#include "src/common/xstring.h"
#include "src/common/slurm_cred.h"
#define disable_localtime() \
_STMT_START { \
_xstrftimecat(NULL, NULL); \
timestr(NULL,NULL,0); \
} _STMT_END
#endif /* !_MACROS_H */ #endif /* !_MACROS_H */
...@@ -1118,7 +1118,7 @@ static char * timestr (const time_t *tp, char *buf, size_t n) ...@@ -1118,7 +1118,7 @@ static char * timestr (const time_t *tp, char *buf, size_t n)
if (disabled) return NULL; if (disabled) return NULL;
#endif #endif
if (!localtime_r (tp, &tmval)) if (!localtime_r (tp, &tmval))
error ("localtime: %m"); error ("localtime_r: %m");
strftime (buf, n, fmt, &tmval); strftime (buf, n, fmt, &tmval);
return (buf); return (buf);
} }
......
...@@ -357,10 +357,6 @@ _fork_new_slurmd(slurmd_step_type_t type, void *req, ...@@ -357,10 +357,6 @@ _fork_new_slurmd(slurmd_step_type_t type, void *req,
return ((int) pid); return ((int) pid);
} }
#ifdef DISABLE_LOCALTIME
disable_localtime();
#endif
if (setsid() < 0) if (setsid() < 0)
error("fork_slurmd: setsid: %m"); error("fork_slurmd: setsid: %m");
......
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