[PATCH] state: check return value of chown

Karl Palsson karlp at tweak.net.au
Mon Jan 4 12:08:22 EST 2021


Daniel Golle <daniel at makrotopia.org> wrote:
> On Sat, Jan 02, 2021 at 10:01:36PM +0800, yeholmes at outlook.com
> wrote:

> > -			chown(p->pw_dir, p->pw_uid, p->pw_gid);
> > +			if (chown(p->pw_dir, p->pw_uid, p->pw_gid))
> > +				fprintf(stderr, "Failed to change ownership for %s\n", p->pw_dir);
> 
> Please let's not have a custom error message for cases which
> practically never occur. If we would really cover all that,
> around 80% of the size of executables like procd would be error
> messages. Imho an assertion is the right thing to do here.
> 

Do we compile with assertions enabled?

Sincerely,
Karl Palsson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP-digital-signature.html
Type: application/pgp-signature
Size: 1175 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210104/00e83812/attachment.sig>


More information about the openwrt-devel mailing list