From dc1ffc059ae16a21eadfadd15c1940d73bc8562f Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Wed, 1 Jun 2005 18:35:11 +0000
Subject: [PATCH] Fix a couple of minor issues for clean build on AIX with new
 HP code.

---
 NEWS                                  | 3 +++
 src/plugins/jobacct/log/jobacct_log.c | 5 ++++-
 src/sacct/sacct.c                     | 5 ++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 4113ec02cbd..ad7acdc78f9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 This file describes changes in recent versions of SLURM. It primarily
 documents those changes that are of interest to users and admins. 
 
+* Changes in SLURM 0.5.0-pre8
+=============================
+
 * Changes in SLURM 0.5.0-pre7
 =============================
  -- Preserve next_job_id across restarts.
diff --git a/src/plugins/jobacct/log/jobacct_log.c b/src/plugins/jobacct/log/jobacct_log.c
index cef89e92882..c25fb91cdf9 100644
--- a/src/plugins/jobacct/log/jobacct_log.c
+++ b/src/plugins/jobacct/log/jobacct_log.c
@@ -937,13 +937,15 @@ static int _get_process_data_line(FILE *in, _prec_t *prec) {
 	/* discardable data */
 	int		d;
 	char		c;
-	char		s[NAME_MAX+1];
+	char		*s;
 	long int	ld;
 	unsigned long	lu;
+	int max_path_len = pathconf("/", _PC_NAME_MAX);
 
 	/* useful datum */
 	int		nvals;
 
+	s = xmalloc(max_path_len + 1);
 	nvals=fscanf(in,
 		"%d %s %c %d %d "
 		"%d %d %d %lu %lu "
@@ -962,6 +964,7 @@ static int _get_process_data_line(FILE *in, _prec_t *prec) {
 	 *	cutime, cstime, priority, nice, lit_0,
 	 *	itrealvalue, starttime, vsize, rss, rlim
 	 */
+	xfree(s);
 	if (nvals != 25)	/* Is it what we expected? */
 		return 0;	/* No! */
 	prec->psize *= getpagesize();	/* convert pages to bytes */
diff --git a/src/sacct/sacct.c b/src/sacct/sacct.c
index 539ddb50686..cd1c7894cb6 100644
--- a/src/sacct/sacct.c
+++ b/src/sacct/sacct.c
@@ -25,6 +25,9 @@
 /*
  * HISTORY
  * $Log$
+ * Revision 1.2  2005/06/01 18:35:11  jette
+ * Fix a couple of minor issues for clean build on AIX with new HP code.
+ *
  * Revision 1.1  2005/06/01 17:26:11  jette
  * Extensive mods checked it for HP work, see NEWS for details.
  *
@@ -121,7 +124,6 @@
 
 #include <ctype.h>
 #include <errno.h>
-#include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
@@ -131,6 +133,7 @@
 #include <time.h>
 #include <unistd.h>
 
+#include "src/common/getopt.h"
 #include "src/common/slurm_protocol_api.h"
 
 #define ERROR 2
-- 
GitLab