[Toybox] [PATCH] A implementaion of the ts command

Rob Landley rob at landley.net
Sat Sep 9 19:17:15 PDT 2023



On 9/9/23 11:39, Oliver Webb wrote:
> ------- Original Message -------
> On Friday, September 8th, 2023 at 2:38 AM, Rob Landley <rob at landley.net> wrote:
> 
> 
>> On 9/7/23 23:51, Oliver Webb via Toybox wrote:
>>
>> > I wrote a implementation of the command 'ts' for toybox
>>
> 
> To clarify my earlier emails, I normally wouldn't submit a command this obscure,
> if it wasn't mentioned (Very briefly, but mentioned) in the roadmap page of the project.

It's fine. I merged what you sent locally and did a cleanup pass earlier today.
I've added the -s command from busybox's --help and am frowning at the fact
"dmesg" output gives microseconds and this gives full seconds, and grumbling
about strptime() and friends apparently not having a _concept_ of fractional
seconds and looking what I did in date.c to handle that and wondering if I
should try to genericize it (or just write my own xstrftime() which seems
overkill but there's no other obvious way to do it RIGHT...

I'd poke dalias (Rich Felker, the musl-libc maintainer) about it but he recently
had a "fork() considered harmful" rant that's a bit off the deep end for me. No
I did not make that up:

https://hachyderm.io/@dalias/111026718025749959

(He is, of course, wrong about that...)

> I have improved the source code of ts to fix a memory leak, and remove the
> malloc by just doing what 'date' does and writing to 'toybuf'. I also added
> another reference page that <scsijon at lamiaworks.com> linked
> 
> Since submitting a patch to patch a currently pending patch seems wrong,
> I just made a new standalone one.

I applied your other one this morning, and have already modified it a bit.
Trying to finish up tonight (I got distracted)...

Rob


More information about the Toybox mailing list