@@ -838,6 +838,7 @@ struct export_features *get_export_features(void)
close(fd);
if (c == -1)
goto err;
+ buf[c] = 0;
c = sscanf(buf, "%x %x", &ef.flags, &ef.secinfo_flags);
if (c != 2)
goto err;
@@ -85,8 +85,11 @@ grab_lockfile()
static void
release_lockfile()
{
- if (_lockfd != -1)
+ if (_lockfd != -1) {
lockf(_lockfd, F_ULOCK, 0);
+ close(_lockfd);
+ _lockfd = -1;
+ }
}
int
@@ -184,6 +187,7 @@ main(int argc, char **argv)
xtab_export_read();
dump(f_verbose, f_export_format);
free_state_path_names(&etab);
+ export_freeall();
return 0;
}
}
@@ -225,6 +229,7 @@ main(int argc, char **argv)
xtab_export_write();
cache_flush(force_flush);
free_state_path_names(&etab);
+ export_freeall();
return export_errno;
}
Signed-off-by: Doug Nazar <nazard@nazar.ca> --- support/nfs/exports.c | 1 + utils/exportfs/exportfs.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-)