diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1
index da5e03633347ab7294e0d8110edf89d7a6870b1d..763541bf7740b11228a1f0c04602ff950570e4e4 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 b24d72d50bfbe5c5eb9a02a445e886fa10b0cfa6..094a94a804529fac39aff25d95242126d76b0689 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 62d4df42800d6b17790121c3447d9722ddc4daf6..53575f5aa0e1db51702cb6cae4bbad6ba746f0df 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>