From 1ed4692370ca9ad0c2c6ac451ef97987c46ace71 Mon Sep 17 00:00:00 2001
From: Don Lipari <lipari1@llnl.gov>
Date: Wed, 8 Apr 2009 21:34:18 +0000
Subject: [PATCH] Added SLURM_SUBMIT_DIR to sbatch man page

---
 doc/man/man1/sbatch.1 |  3 +++
 src/sbatch/sbatch.c   | 22 +++++++++++-----------
 src/srun/srun.c       |  1 -
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1
index da5e0363334..763541bf774 100644
--- a/doc/man/man1/sbatch.1
+++ b/doc/man/man1/sbatch.1
@@ -1002,6 +1002,9 @@ If the job has been restarted due to system failure or has been
 explicitly requeued, this will be sent to the number of times
 the job has been restarted.
 .TP
+\fBSLURM_SUBMIT_DIR\fR
+The directory from which \fBsbatch\fR was invoked.
+.TP
 \fBMPIRUN_PARTITION\fR
 The block name on Blue Gene systems only.
 
diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c
index b24d72d50bf..094a94a8045 100644
--- a/src/sbatch/sbatch.c
+++ b/src/sbatch/sbatch.c
@@ -54,11 +54,11 @@
 
 static int   fill_job_desc_from_opts(job_desc_msg_t *desc);
 static void *get_script_buffer(const char *filename, int *size);
-static void  set_prio_process_env(void);
-static void  set_submit_dir_env(void);
-static int   set_umask_env(void);
 static char *script_wrap(char *command_string);
-static int  _set_rlimit_env(void);
+static void  _set_prio_process_env(void);
+static int   _set_rlimit_env(void);
+static void  _set_submit_dir_env(void);
+static int   _set_umask_env(void);
 
 int main(int argc, char *argv[])
 {
@@ -112,9 +112,9 @@ int main(int argc, char *argv[])
 		(void) _set_rlimit_env();
 	}
 
-	set_prio_process_env();
-	set_submit_dir_env();
-	set_umask_env();
+	_set_prio_process_env();
+	_set_submit_dir_env();
+	_set_umask_env();
 	slurm_init_job_desc_msg(&desc);
 	if (fill_job_desc_from_opts(&desc) == -1) {
 		exit(2);
@@ -307,7 +307,7 @@ static int fill_job_desc_from_opts(job_desc_msg_t *desc)
 }
 
 /* Set SLURM_SUBMIT_DIR environment variable with current state */
-static void set_submit_dir_env(void)
+static void _set_submit_dir_env(void)
 {
 	char buf[MAXPATHLEN + 1];
 
@@ -325,7 +325,7 @@ static void set_submit_dir_env(void)
 }
 
 /* Set SLURM_UMASK environment variable with current state */
-static int set_umask_env(void)
+static int _set_umask_env(void)
 {
 	char mask_char[5];
 	mode_t mask;
@@ -347,13 +347,13 @@ static int set_umask_env(void)
 }
 
 /*
- * set_prio_process_env
+ * _set_prio_process_env
  *
  * Set the internal SLURM_PRIO_PROCESS environment variable to support
  * the propagation of the users nice value and the "PropagatePrioProcess"
  * config keyword.
  */
-static void  set_prio_process_env(void)
+static void  _set_prio_process_env(void)
 {
 	int retval;
 
diff --git a/src/srun/srun.c b/src/srun/srun.c
index 62d4df42800..53575f5aa0e 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -69,7 +69,6 @@
 #include <signal.h>
 #include <termios.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <grp.h>
 
 
-- 
GitLab