public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - config: Record time/date rather than path Date: Wed, 09 Sep 2009 13:39:00 -0000 [thread overview] Message-ID: <20090909133834.3EBF8120195@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7b104c967022cf1d1b961e65ebd9796edf485c4f Commit: 7b104c967022cf1d1b961e65ebd9796edf485c4f Parent: 64b7b036cdbb228508bbe2c3c667fc775b940c79 Author: Lon Hohberger <lhh@redhat.com> AuthorDate: Wed Sep 9 09:38:01 2009 -0400 Committer: Lon Hohberger <lhh@redhat.com> CommitterDate: Wed Sep 9 09:38:01 2009 -0400 config: Record time/date rather than path Signed-off-by: Lon Hohberger <lhh@redhat.com> --- config/plugins/ldap/99cluster.ldif | 2 +- config/tools/ldap/rng2ldif/rng2ldif.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config/plugins/ldap/99cluster.ldif b/config/plugins/ldap/99cluster.ldif index a894abb..5fc9ee8 100644 --- a/config/plugins/ldap/99cluster.ldif +++ b/config/plugins/ldap/99cluster.ldif @@ -1,4 +1,4 @@ -# Auto-generated from ../../xml/cluster.rng +# Auto-generated @ 2009-09-09 09:35:50 dn: cn=schema attributeTypes: ( 1.3.6.1.4.1.2312.8.1.1.15 NAME 'rhcsAlias' diff --git a/config/tools/ldap/rng2ldif/rng2ldif.c b/config/tools/ldap/rng2ldif/rng2ldif.c index 39e2cbc..ea99e8b 100644 --- a/config/tools/ldap/rng2ldif/rng2ldif.c +++ b/config/tools/ldap/rng2ldif/rng2ldif.c @@ -3,6 +3,7 @@ #include <sys/types.h> #include <string.h> #include <unistd.h> +#include <time.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> @@ -126,6 +127,9 @@ write_ldap_schema(const char *rng, const char *arg, struct ldap_object_node *obj = NULL; char filename[4096]; FILE *out_ldap = NULL; + char now_asc[128]; + time_t now; + struct tm now_tm; int fd = -1; if (!strcmp(arg, "-")) { @@ -146,7 +150,15 @@ write_ldap_schema(const char *rng, const char *arg, } } - fprintf(out_ldap, "# Auto-generated from %s\n", rng); + now = time(NULL); + memset(&now_tm, 0, sizeof(now_tm)); + if (localtime_r(&now, &now_tm) == NULL) { + snprintf(now_asc, sizeof(now_asc), "???"); + } else { + strftime(now_asc, sizeof(now_asc), "%F %T", &now_tm); + } + + fprintf(out_ldap, "# Auto-generated @ %s\n", now_asc); fprintf(out_ldap, "dn: cn=schema\n"); for (attr = attrs; attr; attr = attr->next)
reply other threads:[~2009-09-09 13:39 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090909133834.3EBF8120195@lists.fedorahosted.org \ --to=lon@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).