[systemd-devel] [PATCH 5/7] calendar: re-ordering 'weekly'
Lennart Poettering
lennart at poettering.net
Mon Oct 27 05:43:16 PDT 2014
On Mon, 27.10.14 08:42, Daniele Medri (dmedri at gmail.com) wrote:
Hmm, can you elaborate on this change and why you made it?
> ---
> src/shared/calendarspec.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
> index 6186301..fae7dfd 100644
> --- a/src/shared/calendarspec.c
> +++ b/src/shared/calendarspec.c
> @@ -857,10 +857,10 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
> if (r < 0)
> goto fail;
>
> - } else if (strcaseeq(p, "monthly")) {
> - r = const_chain(1, &c->day);
> - if (r < 0)
> - goto fail;
> + } else if (strcaseeq(p, "weekly")) {
> +
> + c->weekdays_bits = 1;
> +
> r = const_chain(0, &c->hour);
> if (r < 0)
> goto fail;
> @@ -871,11 +871,7 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
> if (r < 0)
> goto fail;
>
> - } else if (strcaseeq(p, "annually") || strcaseeq(p, "yearly")
> - || strcaseeq(p, "anually") /* backwards compatibility */ ) {
> - r = const_chain(1, &c->month);
> - if (r < 0)
> - goto fail;
> + } else if (strcaseeq(p, "monthly")) {
> r = const_chain(1, &c->day);
> if (r < 0)
> goto fail;
> @@ -889,10 +885,14 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
> if (r < 0)
> goto fail;
>
> - } else if (strcaseeq(p, "weekly")) {
> -
> - c->weekdays_bits = 1;
> -
> + } else if (strcaseeq(p, "annually") || strcaseeq(p, "yearly")
> + || strcaseeq(p, "anually") /* backwards compatibility */ ) {
> + 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;
> --
> 1.9.3
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list