* [PATCH] hwclock: fix non-linux build
@ 2017-04-11 8:05 Ruediger Meier
2017-04-11 18:45 ` J William Piggott
0 siblings, 1 reply; 7+ messages in thread
From: Ruediger Meier @ 2017-04-11 8:05 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
From: Ruediger Meier <ruediger.meier@ga-group.nl>
There was one missing ifdef since 336f7c5f.
CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
sys-utils/hwclock.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 3875bcc..3e0d6e9 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1520,9 +1520,12 @@ int main(int argc, char **argv)
}
}
- if (!(ctl.show | ctl.set | ctl.systohc | ctl.hctosys |
- ctl.systz | ctl.adjust | ctl.getepoch | ctl.setepoch |
- ctl.predict | ctl.get))
+ if (!(ctl.show | ctl.set | ctl.systohc | ctl.hctosys
+ | ctl.systz | ctl.adjust | ctl.predict | ctl.get
+#ifdef __linux__
+ | ctl.getepoch | ctl.setepoch
+#endif
+ ))
ctl.show = 1; /* default to show */
#ifdef __linux__
--
1.8.5.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] hwclock: fix non-linux build
2017-04-11 8:05 [PATCH] hwclock: fix non-linux build Ruediger Meier
@ 2017-04-11 18:45 ` J William Piggott
2017-04-11 19:07 ` Ruediger Meier
0 siblings, 1 reply; 7+ messages in thread
From: J William Piggott @ 2017-04-11 18:45 UTC (permalink / raw)
To: Ruediger Meier, util-linux; +Cc: Sami Kerola
On 04/11/2017 04:05 AM, Ruediger Meier wrote:
> From: Ruediger Meier <ruediger.meier@ga-group.nl>
>
> There was one missing ifdef since 336f7c5f.
They were both in that 'if' test before 336f7c5f:
- if (!(show | set | systohc | hctosys | systz | adjust | getepoch
- | setepoch | predict | compare | get))
- show = 1; /* default to show */
But they were defined for all arches then:
- /* Set option defaults */
- show = set = systohc = hctosys = systz = adjust = noadjfile = predict =
- compare = get = update = FALSE;
- getepoch = setepoch = utc = local_opt = directisa = testing = debug = FALSE;
I think the old way was a cleaner solution, so in sys-utils/hwclock.h:35:
- #ifdef __linux__
getepoch:1,
setepoch:1,
- #endif
Should work? I do not have a way to test it.
>
> CC: Sami Kerola <kerolasa@iki.fi>
> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> ---
> sys-utils/hwclock.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
> index 3875bcc..3e0d6e9 100644
> --- a/sys-utils/hwclock.c
> +++ b/sys-utils/hwclock.c
> @@ -1520,9 +1520,12 @@ int main(int argc, char **argv)
> }
> }
>
> - if (!(ctl.show | ctl.set | ctl.systohc | ctl.hctosys |
> - ctl.systz | ctl.adjust | ctl.getepoch | ctl.setepoch |
> - ctl.predict | ctl.get))
> + if (!(ctl.show | ctl.set | ctl.systohc | ctl.hctosys
> + | ctl.systz | ctl.adjust | ctl.predict | ctl.get
> +#ifdef __linux__
> + | ctl.getepoch | ctl.setepoch
> +#endif
> + ))
> ctl.show = 1; /* default to show */
>
> #ifdef __linux__
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] hwclock: fix non-linux build
2017-04-11 18:45 ` J William Piggott
@ 2017-04-11 19:07 ` Ruediger Meier
2017-04-11 19:27 ` J William Piggott
0 siblings, 1 reply; 7+ messages in thread
From: Ruediger Meier @ 2017-04-11 19:07 UTC (permalink / raw)
To: J William Piggott; +Cc: util-linux, Sami Kerola
On Tuesday 11 April 2017, J William Piggott wrote:
> On 04/11/2017 04:05 AM, Ruediger Meier wrote:
> > From: Ruediger Meier <ruediger.meier@ga-group.nl>
> >
> > There was one missing ifdef since 336f7c5f.
>
> They were both in that 'if' test before 336f7c5f:
>
> - if (!(show | set | systohc | hctosys | systz | adjust |
> getepoch - | setepoch | predict | compare | get))
> - show = 1; /* default to show */
>
> But they were defined for all arches then:
>
> - /* Set option defaults */
> - show = set = systohc = hctosys = systz = adjust = noadjfile =
> predict = - compare = get = update = FALSE;
> - getepoch = setepoch = utc = local_opt = directisa = testing =
> debug = FALSE;
>
>
> I think the old way was a cleaner solution, so in
> sys-utils/hwclock.h:35:
>
> - #ifdef __linux__
> getepoch:1,
> setepoch:1,
> - #endif
>
> Should work? I do not have a way to test it.
Yes, I've had also thought about this but was not sure and also too lazy
to check possible side effects. Somehow I think we should either remove
all ifdefs (__linux__, __alpha__, HAVE_LIBAUDIT) from that struct or
none.
cu,
Rudi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] hwclock: fix non-linux build
2017-04-11 19:07 ` Ruediger Meier
@ 2017-04-11 19:27 ` J William Piggott
2017-04-17 1:44 ` J William Piggott
0 siblings, 1 reply; 7+ messages in thread
From: J William Piggott @ 2017-04-11 19:27 UTC (permalink / raw)
To: Ruediger Meier; +Cc: util-linux, Sami Kerola
On 04/11/2017 03:07 PM, Ruediger Meier wrote:
> On Tuesday 11 April 2017, J William Piggott wrote:
>> On 04/11/2017 04:05 AM, Ruediger Meier wrote:
>>> From: Ruediger Meier <ruediger.meier@ga-group.nl>
>>>
>>> There was one missing ifdef since 336f7c5f.
>>
>> They were both in that 'if' test before 336f7c5f:
>>
>> - if (!(show | set | systohc | hctosys | systz | adjust |
>> getepoch - | setepoch | predict | compare | get))
>> - show = 1; /* default to show */
>>
>> But they were defined for all arches then:
>>
>> - /* Set option defaults */
>> - show = set = systohc = hctosys = systz = adjust = noadjfile =
>> predict = - compare = get = update = FALSE;
>> - getepoch = setepoch = utc = local_opt = directisa = testing =
>> debug = FALSE;
>>
>>
>> I think the old way was a cleaner solution, so in
>> sys-utils/hwclock.h:35:
>>
>> - #ifdef __linux__
>> getepoch:1,
>> setepoch:1,
>> - #endif
>>
>> Should work? I do not have a way to test it.
>
> Yes, I've had also thought about this but was not sure and also too lazy
> to check possible side effects. Somehow I think we should either remove
> all ifdefs (__linux__, __alpha__, HAVE_LIBAUDIT) from that struct or
> none.
I don't expect any side effects from getepoch setepoch, because they
were historically initialized on all arches. Alpha has already been
removed. The other two, rtc_dev_name and hwaudit_on, are only used
inside of #ifdef so I think they must remain so in the struct as well.
>
> cu,
> Rudi
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] hwclock: fix non-linux build
2017-04-11 19:27 ` J William Piggott
@ 2017-04-17 1:44 ` J William Piggott
2017-04-18 9:10 ` Karel Zak
0 siblings, 1 reply; 7+ messages in thread
From: J William Piggott @ 2017-04-17 1:44 UTC (permalink / raw)
To: Ruediger Meier; +Cc: util-linux, Sami Kerola
Rudi,
I have a different solution that removes that default function test
completely. It is part of another fix in my current working branch, so I
will post it as soon as Karel accepts/rejects my current submission.
On 04/11/2017 03:27 PM, J William Piggott wrote:
>
>
> On 04/11/2017 03:07 PM, Ruediger Meier wrote:
>> On Tuesday 11 April 2017, J William Piggott wrote:
>>> On 04/11/2017 04:05 AM, Ruediger Meier wrote:
>>>> From: Ruediger Meier <ruediger.meier@ga-group.nl>
>>>>
>>>> There was one missing ifdef since 336f7c5f.
>>>
>>> They were both in that 'if' test before 336f7c5f:
>>>
>>> - if (!(show | set | systohc | hctosys | systz | adjust |
>>> getepoch - | setepoch | predict | compare | get))
>>> - show = 1; /* default to show */
>>>
>>> But they were defined for all arches then:
>>>
>>> - /* Set option defaults */
>>> - show = set = systohc = hctosys = systz = adjust = noadjfile =
>>> predict = - compare = get = update = FALSE;
>>> - getepoch = setepoch = utc = local_opt = directisa = testing =
>>> debug = FALSE;
>>>
>>>
>>> I think the old way was a cleaner solution, so in
>>> sys-utils/hwclock.h:35:
>>>
>>> - #ifdef __linux__
>>> getepoch:1,
>>> setepoch:1,
>>> - #endif
>>>
>>> Should work? I do not have a way to test it.
>>
>> Yes, I've had also thought about this but was not sure and also too lazy
>> to check possible side effects. Somehow I think we should either remove
>> all ifdefs (__linux__, __alpha__, HAVE_LIBAUDIT) from that struct or
>> none.
>
> I don't expect any side effects from getepoch setepoch, because they
> were historically initialized on all arches. Alpha has already been
> removed. The other two, rtc_dev_name and hwaudit_on, are only used
> inside of #ifdef so I think they must remain so in the struct as well.
>
>
>
>>
>> cu,
>> Rudi
>> --
>> To unsubscribe from this list: send the line "unsubscribe util-linux" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] hwclock: fix non-linux build
2017-04-17 1:44 ` J William Piggott
@ 2017-04-18 9:10 ` Karel Zak
2017-04-19 3:28 ` J William Piggott
0 siblings, 1 reply; 7+ messages in thread
From: Karel Zak @ 2017-04-18 9:10 UTC (permalink / raw)
To: J William Piggott; +Cc: Ruediger Meier, util-linux, Sami Kerola
On Sun, Apr 16, 2017 at 09:44:00PM -0400, J William Piggott wrote:
> Rudi,
>
> I have a different solution that removes that default function test
> completely. It is part of another fix in my current working branch, so I
> will post it as soon as Karel accepts/rejects my current submission.
I guess I can wait for something better rather than accept this one, right?
(previous accepted)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] hwclock: fix non-linux build
2017-04-18 9:10 ` Karel Zak
@ 2017-04-19 3:28 ` J William Piggott
0 siblings, 0 replies; 7+ messages in thread
From: J William Piggott @ 2017-04-19 3:28 UTC (permalink / raw)
To: Karel Zak; +Cc: Ruediger Meier, util-linux, Sami Kerola
On 04/18/2017 05:10 AM, Karel Zak wrote:
> On Sun, Apr 16, 2017 at 09:44:00PM -0400, J William Piggott wrote:
>> Rudi,
>>
>> I have a different solution that removes that default function test
>> completely. It is part of another fix in my current working branch, so I
>> will post it as soon as Karel accepts/rejects my current submission.
>
> I guess I can wait for something better rather than accept this one, right?
> (previous accepted)
I like your optimism, I hope it is better;)
I just posted it in my next pull request.
>
> Karel
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-04-19 3:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-11 8:05 [PATCH] hwclock: fix non-linux build Ruediger Meier
2017-04-11 18:45 ` J William Piggott
2017-04-11 19:07 ` Ruediger Meier
2017-04-11 19:27 ` J William Piggott
2017-04-17 1:44 ` J William Piggott
2017-04-18 9:10 ` Karel Zak
2017-04-19 3:28 ` J William Piggott
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.