From 3ca6f99ce2478584a5275a400e5b843163a538a4 Mon Sep 17 00:00:00 2001
From: Janne Blomqvist <janne.blomqvist@aalto.fi>
Date: Tue, 6 Nov 2012 09:41:00 -0800
Subject: [PATCH] Fix/Change RPC822 date format to RPC2822 format

---
 src/common/log.c           | 6 +++---
 src/common/log.h           | 6 +++---
 src/slurmd/slurmd/slurmd.c | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/common/log.c b/src/common/log.c
index 77918690594..52d3a26e1f0 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -554,7 +554,7 @@ FILE *log_fp(void)
  * args are like printf, with the addition of the following format chars:
  * - %m expands to strerror(errno)
  * - %t expands to strftime("%x %X") [ locally preferred short date/time ]
- * - %T expands to rfc822 date time  [ "dd Mon yyyy hh:mm:ss GMT offset" ]
+ * - %T expands to rfc2822 date time  [ "dd, Mon yyyy hh:mm:ss GMT offset" ]
  *
  * simple format specifiers are handled explicitly to avoid calls to
  * vsnprintf and allow dynamic sizing of the message buffer. If a call
@@ -599,8 +599,8 @@ static char *vxstrfmt(const char *fmt, va_list ap)
 			case 't': 	/* "%t" => locally preferred date/time*/
 				xstrftimecat(buf, "%x %X");
 				break;
-			case 'T': 	/* "%T" => "dd Mon yyyy hh:mm:ss off" */
-				xstrftimecat(buf, "%a %d %b %Y %H:%M:%S %z");
+			case 'T': 	/* "%T" => "dd, Mon yyyy hh:mm:ss off" */
+				xstrftimecat(buf, "%a, %d %b %Y %H:%M:%S %z");
 				break;
 #if defined USE_USEC_CLOCK
 			case 'M':       /* "%M" => "usec"                    */
diff --git a/src/common/log.h b/src/common/log.h
index 0c71156005b..4bc1df96cdb 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -133,8 +133,8 @@ typedef struct {
 }
 
 
-#define RFC822_TIMESTAMP(timestamp_buf) \
-	MAKE_TIMESTAMP(timestamp_buf, "%a %d %b %Y %H:%M:%S %z");
+#define RFC2822_TIMESTAMP(timestamp_buf) \
+	MAKE_TIMESTAMP(timestamp_buf, "%a, %d %b %Y %H:%M:%S %z");
 
 #ifdef USE_ISO_8601
 #define LOG_TIMESTAMP(timestamp_buf)			\
@@ -250,7 +250,7 @@ void log_flush(void);
  * ~~~~    ~~~~~~~~~~~
  * "%m" => strerror(errno)
  * "%t" => strftime "%x %X"  (locally preferred short date/time)
- * "%T" => strftime "%a %d %b %Y %H:%M:%S %z" (rfc822 date/time)
+ * "%T" => strftime "%a, %d %b %Y %H:%M:%S %z" (rfc2822 date/time)
  */
 
 /* fatal() aborts program unless NDEBUG defined
diff --git a/src/slurmd/slurmd/slurmd.c b/src/slurmd/slurmd/slurmd.c
index fc5de73b6c5..d91102cf44e 100644
--- a/src/slurmd/slurmd/slurmd.c
+++ b/src/slurmd/slurmd/slurmd.c
@@ -307,7 +307,7 @@ main (int argc, char *argv[])
 	if (pidfd >= 0)
 		fd_set_close_on_exec(pidfd);
 
-	RFC822_TIMESTAMP(time_stamp);
+	RFC2822_TIMESTAMP(time_stamp);
 	info("%s started on %s", xbasename(argv[0]), time_stamp);
 
 	_install_fork_handlers();
-- 
GitLab