[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] ntpd: Implement the "-q" option.
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2009-11-23 15:28:08
Message-ID: 1158166a0911230728sf979bbbg1496bc7f382a8700 () mail ! gmail ! com
[Download RAW message or body]

On Mon, Nov 23, 2009 at 3:43 PM, Adam Tkac <vonsch@gmail.com> wrote:
>> > Main reason why I used different options than reference NTP software
>> > (www.ntp.org) is that busybox applet is based on OpenNTP
>> > (www.openntpd.org). Denys already renamed all options as in reference
>> > NTP.

And they have different options? What alternatively gifted people...

>> > The "-g" parameter is already supported and I don't think we need to
>> > implement "-q". You can simply wait till clock is set and then
>> > terminate applet via SIG{INT,TERM}, for example.
>>
>> but this is bad for scripting. NTL using common options improves accepting
>> and script suddenly are portable.
>
> Implementation of the "-q" option to ntpd. Size +50 B. Please apply it
> to the main source.
>
> Note this patch also fixes a bug in the client_dispatch() function.
> There was reversed if() condition.

        OPT_l = (1 << 3),
+       OPT_q = (1 << 4)

if !FEATURE_NTPD_SERVER, -l doesn't exist and you get wrong bit position
for OPT_q.


+       smallint        exit_after_settime;
...
+       if (G.exit_after_settime)
+               exit(0);
...
+       if (opts & OPT_q)
+               G.exit_after_settime = 1;

Why bother passing it around, the bit is accessible
in global option_mask32 variable.

I reworked it a bit and pushed to git. Thanks!
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic