public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/, src/includes/
Date: Fri, 12 May 2017 02:42:46 +0000 (UTC)	[thread overview]
Message-ID: <1494537732.6b4050ab9cf9d678a1d6b7af7af7494f8533dbca.williamh@OpenRC> (raw)

commit:     6b4050ab9cf9d678a1d6b7af7af7494f8533dbca
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu May 11 21:18:41 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu May 11 21:22:12 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=6b4050ab

fix from_time_t function

 src/includes/rc-misc.h    | 2 +-
 src/rc/rc-misc.c          | 5 +----
 src/rc/supervise-daemon.c | 4 +++-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h
index 384328e7..95ccbc33 100644
--- a/src/includes/rc-misc.h
+++ b/src/includes/rc-misc.h
@@ -69,7 +69,7 @@ RC_DEPTREE *_rc_deptree_load (int, int *);
 bool _rc_can_find_pids(void);
 
 RC_SERVICE lookup_service_state(const char *service);
-char *from_time_t(time_t tv);
+void from_time_t(char *time_string, time_t tv);
 time_t to_time_t(char *timestring);
 
 #endif

diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index b75c3b4e..1a98537c 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -443,12 +443,9 @@ RC_SERVICE lookup_service_state(const char *service)
 	return 0;
 }
 
-char *from_time_t(time_t tv)
+void from_time_t(char *time_string, time_t tv)
 {
-	char time_string[20];
-
 	strftime(time_string, 20, "%Y-%m-%d %H:%M:%S", localtime(&tv));
-	return time_string;
 }
 
 time_t to_time_t(char *timestring)

diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index a971e6a3..f3335fa2 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -186,6 +186,7 @@ static void child_process(char *exec, char **argv, char *svcname,
 	char cmdline[PATH_MAX];
 	time_t start_time;
 	char start_count_string[20];
+	char start_time_string[20];
 
 #ifdef HAVE_PAM
 	pam_handle_t *pamh = NULL;
@@ -343,7 +344,8 @@ static void child_process(char *exec, char **argv, char *svcname,
 	syslog(LOG_INFO, "Running command line: %s", cmdline);
 	if (svcname) {
 start_time = time(NULL);
-		rc_service_value_set(svcname, "start_time", from_time_t(start_time));
+from_time_t(start_time_string, start_time);
+		rc_service_value_set(svcname, "start_time", start_time_string);
 sprintf(start_count_string, "%i", start_count);
 		rc_service_value_set(svcname, "start_count", start_count_string);
 	}


             reply	other threads:[~2017-05-12  2:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12  2:42 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-24 15:33 [gentoo-commits] proj/openrc:master commit in: src/rc/, src/includes/ William Hubbs
2017-06-05 17:18 William Hubbs
2017-05-12  2:42 William Hubbs
2016-01-19  6:12 William Hubbs
2016-01-14 18:55 William Hubbs
2014-10-24  1:07 William Hubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494537732.6b4050ab9cf9d678a1d6b7af7af7494f8533dbca.williamh@OpenRC \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox