[PATCH] date: return failure exit code on set time error
Denys Vlasenko
vda.linux at googlemail.com
Fri Aug 1 09:36:34 UTC 2025
On Thu, Jul 31, 2025 at 10:08 PM Ladislav Michl <oss-lists at triops.cz> wrote:
> Hi Denys,
>
> On Wed, Jul 30, 2025 at 07:46:46PM +0200, Denys Vlasenko wrote:
> > Applied, thank you.
> > Apologies for a big delay.
>
> unfortunately something want wrong here. I sent and was pinging on v2 of
> this patch. Can you revert and apply correct one or shall I send fixup?
You mean, you want a version which does print the date even if date
setting failed?
Yes, I see that this is what date from coreutils 9.1 does,
but is it in any way important? It's not required by
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html
and if your script needs date to be set, then on error, what's important
is that there was an _error_, not which specific date was attempted to be set.
IOW: here the user very much interested in date output:
YYYYMMDD=`date -I`
Here, not so much:
date -s $NEWDATE || exit $?
Am I mistaken? Did you see real-world use where people needed to see the date
after a failure to set it?
The code *can* be changed to "print error, continue till the end,
return error indicator"
logic, but is it worth the code increase?
More information about the busybox
mailing list