[Toybox] fliddling with chgrp.

Rob Landley rob at landley.net
Sat May 19 20:47:44 PDT 2012


I needed to adjust chgrp to work with the new dirtree, and I'm doing a
few cleanups along the way.

1) error_exit() prints an error message to stderr and then exits with an
error: if toys.exitval is 0 it sets it to 1, otherwise it uses it as the
exit value.

2) The difference between error_msg() and perror_message() (and
error_exit() and perror_exit()) is that the p versions append
strerror(errno).  This doesn't seem like what you wanted there.

3) you have:

  if (FLAG_R) for(blah) stuff1;
  else for(blah) stuff2;

Refactored as:

  for (blah) if (FLAG_R) stuff 1: else stuff2;

And some simplifications fell out of that...

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1337485664.0


More information about the Toybox mailing list