From f0a61c2c366f1708e179509dd97c4912f8eb17ff Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Fri, 4 Apr 2008 15:59:14 +0000
Subject: [PATCH] svn merge -r13727:13794
 https://eris.llnl.gov/svn/slurm/branches/slurm-1.2

---
 doc/man/man1/srun.1                       | 9 ++++++---
 src/plugins/select/linear/select_linear.c | 5 +++--
 src/smap/smap.c                           | 3 ++-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index aaac754d404..92aec761cef 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -1385,9 +1385,12 @@ Signals sent to the \fBsrun\fR command are automatically forwarded to
 the tasks it is controlling with a few exceptions. The escape sequence
 \fB<control\-c>\fR will report the state of all tasks associated with 
 the \fBsrun\fR command. If \fB<control\-c>\fR is entered twice within 
-one second, then the associated SIGINT signal will be sent to all tasks.
-If a third \fB<control\-c>\fR is received, the job will be forcefully
-terminated without waiting for remote tasks to exit.
+one second, then the associated SIGINT signal will be sent to all tasks
+and a termination sequence will be entered sending SIGCONT, SIGTERM, 
+and SIGKILL to all spawned tasks.
+If a third \fB<control\-c>\fR is received, the srun program will be 
+terminated without waiting for remote tasks to exit or their I/O to
+complete.
 
 The escape sequence \fB<control\-z>\fR is presently ignored. Our intent 
 is for this put the \fBsrun\fR command into a mode where various special 
diff --git a/src/plugins/select/linear/select_linear.c b/src/plugins/select/linear/select_linear.c
index 5191cda6638..35c80ebb7f2 100644
--- a/src/plugins/select/linear/select_linear.c
+++ b/src/plugins/select/linear/select_linear.c
@@ -1053,8 +1053,9 @@ extern int select_p_get_extra_jobinfo (struct node_record *node_ptr,
 	case SELECT_AVAIL_CPUS:
 		tmp_16 = (uint16_t *) data;
 
-		if ((job_ptr->details->cpus_per_task > 1)
-		||  (job_ptr->details->mc_ptr)) {
+		if (job_ptr->details &&
+		    ((job_ptr->details->cpus_per_task > 1) ||
+		     (job_ptr->details->mc_ptr))) {
 			int index = (node_ptr - node_record_table_ptr);
 			*tmp_16 = _get_avail_cpus(job_ptr, index);
 		} else {
diff --git a/src/smap/smap.c b/src/smap/smap.c
index 3c4aadd2c9f..f98c850c783 100644
--- a/src/smap/smap.c
+++ b/src/smap/smap.c
@@ -249,7 +249,8 @@ part_fini:
 #else
 		default:
 			error("Must be on a BG SYSTEM to run this command");
-			endwin();
+			if(!params.commandline)
+				endwin();
 			ba_fini();
 			exit(0);
 			break;
-- 
GitLab