[DTrace-devel] [PATCH] Need -w for destructive actions, even if clause is not used
Nick Alcock
nick.alcock at oracle.com
Tue Jul 22 13:36:56 UTC 2025
On 17 Jul 2025, Eugene Loh outgrape:
> On 7/15/25 06:59, Nick Alcock wrote:
>
>> On 11 Jul 2025, eugene loh uttered the following:
>>> From: Eugene Loh <eugene.loh at oracle.com>
>>>
>>> If a clause includes a destructive action but -w is not used, dtrace
>>> should not start up, even if the clause is ignored (due to -Z).
>>> Solaris treated this as a runtime error. We should do the same.
>>>
>>> The test err.Z_no-w.sh was misguided and is replaced by a more
>>> direct test.
>>>
>>> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
>> Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
>>
>> modulo one microscopic annoyance (I am not a real unix programmer, I
>> don't like creat() and think we shouldn't add more).
>
> Sorry, I don't know what you're asking for here.
"Name too short" :) referring to:
> > + int dt_havedest; /* have any destructive actions */
> > };
>
> A piteous plea: could we call this dt_have_destructive or something? We
> call destructive stuff "destructive", unabbreviated, everywhere else,
> this flag is only checked in *one place* and thus hardly need concision,
> and to me 'dest' always means 'destination' and thus causes a
> double-take every time I see it used for something else.
Anyway...
>>> + * This check should never fail since, if any action is
>> Grammar:
>>
>> This check should never fail, since if any action is
>
> I think I see what you're saying: separate the two phrases with a
> comma. But there is a big appositional phrase in there ("if any
> action is destructive and -w is not set") and I wanted to set it off
> with the commas. Maybe I'm wrong. Dunno.
I tried that -- it feels clumsier, since you definitely cannot set it
off with a comma but *not* set off the clause surrounding it (as you did
above).
>>> + * destructive and -w is not set, we should already have
>>> + * failed.
>>> + */
>> (but worth keeping anyway, I agree.)
--
NULL && (void)
More information about the DTrace-devel
mailing list