richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
Blob Blame History Raw
From 9e4b36ca509cdcb39afaa9fc7a0f1901b8855647 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 19 Nov 2013 01:13:42 +0100
Subject: [PATCH] calendar: support 'yearly' and 'annually' names the same way
 as cron

---
 src/shared/calendarspec.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
index 7979e23..7075159 100644
--- a/src/shared/calendarspec.c
+++ b/src/shared/calendarspec.c
@@ -686,6 +686,23 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
                 if (r < 0)
                         goto fail;
 
+        } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) {
+                r = const_chain(1, &c->month);
+                if (r < 0)
+                        goto fail;
+                r = const_chain(1, &c->day);
+                if (r < 0)
+                        goto fail;
+                r = const_chain(0, &c->hour);
+                if (r < 0)
+                        goto fail;
+                r = const_chain(0, &c->minute);
+                if (r < 0)
+                        goto fail;
+                r = const_chain(0, &c->second);
+                if (r < 0)
+                        goto fail;
+
         } else if (strcaseeq(p, "weekly")) {
 
                 c->weekdays_bits = 1;