Page MenuHomeFreeBSD

libutil: Make free_iovec() set iovlen to zero, like the manpage says
AcceptedPublic

Authored by arrowd on Wed, Sep 23, 3:38 PM.
Tags
None
Referenced Files
F173150390: D59929.id187506.diff
Wed, Sep 23, 11:03 PM
F173150254: D59929.id187527.diff
Wed, Sep 23, 11:02 PM
F173148810: D59929.diff
Wed, Sep 23, 10:50 PM
F173139301: D59929.diff
Wed, Sep 23, 9:18 PM
F173131648: D59929.id.diff
Wed, Sep 23, 8:04 PM
F173117868: D59929.diff
Wed, Sep 23, 6:00 PM
Subscribers

Details

Reviewers
kib
olce
Group Reviewers
Contributor Reviews (src)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 77219
Build 74102: arc lint + arc unit

Event Timeline

Man page also claims that iov is set to NULL, but you did not do that.
Was there a reason for the change except the man page compliance?

Was there a reason for the change except the man page compliance?

Yes, the idea is to be able to reuse iov and iovlen right away after freeing previous ones:

build_iovec(&iov, &iovlen, ...);
build_iovec(&iov, &iovlen, ...);
...

free_iovec(&iov, &iovlen, ...);

build_iovec(&iov, &iovlen, ...);
build_iovec(&iov, &iovlen, ...);
...

Without this change one has to additionally put

iov = NULL;
iovlen = 0;

after free_iovec.

This revision is now accepted and ready to land.Wed, Sep 23, 7:15 PM