Page MenuHomeFreeBSD

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

Authored by arrowd on Wed, Sep 23, 3:38 PM.
Tags
None
Referenced Files
F173718631: D59929.diff
Sun, Sep 27, 10:32 PM
F173700884: D59929.id187506.diff
Sun, Sep 27, 8:01 PM
Unknown Object (File)
Sun, Sep 27, 5:26 PM
Unknown Object (File)
Sun, Sep 27, 10:53 AM
Unknown Object (File)
Sun, Sep 27, 3:49 AM
Unknown Object (File)
Sun, Sep 27, 2:04 AM
Unknown Object (File)
Sat, Sep 26, 8:55 PM
Unknown Object (File)
Fri, Sep 25, 4:40 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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