chg: check lockfd at freecmdserveropts
We check for sockdirfd at freecmdserveropts but not lockfd, which is a bit
strange to people new to the code. Add a comment and an assert to make it
clear that lockfd should be closed earlier.
--- a/contrib/chg/chg.c Sun Apr 10 23:56:00 2016 +0100
+++ b/contrib/chg/chg.c Sun Apr 10 22:58:11 2016 +0100
@@ -49,6 +49,7 @@
free(opts->args);
opts->args = NULL;
opts->argsize = 0;
+ assert(opts->lockfd == -1 && "should be closed by unlockcmdserver()");
if (opts->sockdirfd != AT_FDCWD) {
close(opts->sockdirfd);
opts->sockdirfd = AT_FDCWD;