Re: [PATCH 1/6 v2] mkfs: Save raw user input field to the opts struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/16/17 4:11 AM, Jan Tulak wrote:
> On Wed, Aug 16, 2017 at 1:07 AM, Eric Sandeen <sandeen@xxxxxxxxxxx> wrote:
>> On 8/15/17 10:08 AM, Jan Tulak wrote:
>>> Save exactly what the user gave us for every option.  This way, we will
>>> never lose the information if we need it to print back an issue.
>>> (Just add the infrastructure now, used in the next patches.)
>>>
>>> Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>
>>
>> Sorry for not getting to the V1 review, catching up from a week off.
> 
> I hope you enjoyed your holiday. :-)

...


>>> +static char *
>>> +get_conf_raw_safe(const struct opt_params *opt, const int subopt)
>>> +{
>>> +     char *str;
>>> +
>>> +     str = NULL;
>>> +
>>> +     if (get_conf_raw(opt, subopt, &str) == -ENOMEM) {
>>> +             fprintf(stderr, "Out of memory!");
>>
>> Seems like using strerror() would be better than a hand-rolled, un-
>> translatable string?
> 
> Every day there is something new. :-)

Yeah, sorry.  But in general, strings need to be translatable; (that was
pointed out before) and strerror() would do that for your for free.

>>
>>> +             return NULL;
>>> +     }
>>
>> Again, I don't see that any subsequent patches ever call get_conf_raw();
>> is there any reason to even have this wrapper now?
> 
> Luis had a pretty strong opinion about having them there when he will
> need them in his own patches later on and I saw no reason why not to
> add them right now when the functions are created. After all, they
> will be useful later on also for me, when I want to limit the amount
> of asserts and be more return-oriented. It's just not in this
> patchset.

Hm, ok.  Let me reread that, thread - I'm just looking at this patchset
as sent.

In general, I'm not clear on what your "_safe" and "_unsafe" variants
are about but maybe it was discussed in the prior thread I skipped.

Thanks,
-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux