From: zt20xx Date: Tue, 8 Apr 2025 00:49:51 +0000 (+0800) Subject: swapoff: add comments for do_swapoff X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19a6212162a68f5b2e867239d4052c488f381946;p=thirdparty%2Futil-linux.git swapoff: add comments for do_swapoff [kzak@redhat.com: - add the comment to swapoff_by() too] Signed-off-by: Karel Zak --- diff --git a/sys-utils/swapoff.c b/sys-utils/swapoff.c index ab7e4ca11..70422c9e2 100644 --- a/sys-utils/swapoff.c +++ b/sys-utils/swapoff.c @@ -104,7 +104,8 @@ static int do_swapoff(const char *orig_special, int quiet, int canonic) if (!canonic) { char *n, *v; - + /* The mntcache is always used; see the main(). There is no + * need to free the memory allocated by mnt_resolve_spec(). */ special = mnt_resolve_spec(orig_special, mntcache); if (!special && blkid_parse_tag_string(orig_special, &n, &v) == 0) { special = buf = resolve_swapfile_tag(n, v); @@ -147,6 +148,8 @@ static int swapoff_by(const char *name, const char *value, int quiet) char *buf = NULL; int rc; + /* The mntcache is always used; see the main(). There is no + * need to free the memory allocated by mnt_resolve_tag(). */ special = mnt_resolve_tag(name, value, mntcache); if (!special) special = buf = resolve_swapfile_tag(name, value);