daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
572a44
From 9e4b36ca509cdcb39afaa9fc7a0f1901b8855647 Mon Sep 17 00:00:00 2001
572a44
From: Lennart Poettering <lennart@poettering.net>
572a44
Date: Tue, 19 Nov 2013 01:13:42 +0100
572a44
Subject: [PATCH] calendar: support 'yearly' and 'annually' names the same way
572a44
 as cron
572a44
572a44
---
572a44
 src/shared/calendarspec.c | 17 +++++++++++++++++
572a44
 1 file changed, 17 insertions(+)
572a44
572a44
diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
572a44
index 7979e23..7075159 100644
572a44
--- a/src/shared/calendarspec.c
572a44
+++ b/src/shared/calendarspec.c
572a44
@@ -686,6 +686,23 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
572a44
                 if (r < 0)
572a44
                         goto fail;
572a44
 
572a44
+        } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) {
572a44
+                r = const_chain(1, &c->month);
572a44
+                if (r < 0)
572a44
+                        goto fail;
572a44
+                r = const_chain(1, &c->day);
572a44
+                if (r < 0)
572a44
+                        goto fail;
572a44
+                r = const_chain(0, &c->hour);
572a44
+                if (r < 0)
572a44
+                        goto fail;
572a44
+                r = const_chain(0, &c->minute);
572a44
+                if (r < 0)
572a44
+                        goto fail;
572a44
+                r = const_chain(0, &c->second);
572a44
+                if (r < 0)
572a44
+                        goto fail;
572a44
+
572a44
         } else if (strcaseeq(p, "weekly")) {
572a44
 
572a44
                 c->weekdays_bits = 1;