On Sun, 10 Apr 2022 14:43:16 +0200
"Jason A. Donenfeld" <ja...@zx2c4.com> wrote:

> > mkdir: bb_make_directory  
> 
> This one wasn't so useful: I don't actually want _recursive_ directory
> creation, I don't think.

Probably. But it doesn't harm either. And if it saves size it's
preferable.

Also seed_dir et al are only used in main so i'd move them there and
not have them static. Doesn't make much difference though.

Furthermore you don't need separate realtime and boottime storage.

fprintf(stderr,...,strerror(errno)) -> bb_simple_perror_msg_and_die
or bb_perror_msg_and_die

> 
> > Why do you open(), flock() instead of using O_EXCL?  
> 
> So that if the system crashes, the next boot can still move forward,

The next boot will not find any previous data i assume? I thought they
live in /run which usually is not in battery backed up RAM.

I'd first create the directories and try to obtain the exclusive lock
and only then start fiddling with the hash, no?

> or if the process crashes, the next run can still move forward.
> flock() is a runtime thing, where as O_EXCL is a "must be in
> filesystem" thing, which is much weaker.

I admit i did not really look. Don't you ever only want to run one
instance at once? I had thought so, no?
Maybe you can write a small introductory note at the top of the file
that describes the theory of operation, please?

I'd put the out: cleanup dance in an
if (ENABLE_FEATURE_CLEAN_UP) guard
> 
> v3 coming right up! Thanks again for the feedback.
> 
> Jason

thanks,
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to