* [PATCH] libmount: initialize *root to NULL in mnt_table_get_root_fs
@ 2014-02-16 13:58 Thomas Bächler
2014-02-17 12:37 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bächler @ 2014-02-16 13:58 UTC (permalink / raw)
To: util-linux; +Cc: Thomas Bächler
mnt_table_get_root_fs only works when *root is set to NULL. This
is not only undocumented, but also unintuitive. Fix it by initializing
*root inside mnt_table_get_root_fs.
---
libmount/src/tab.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 8ae49c8..7a253e8 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -501,6 +501,7 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)
struct libmnt_iter itr;
struct libmnt_fs *fs;
int root_id = 0;
+ *root = NULL;
assert(tb);
assert(root);
--
1.8.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libmount: initialize *root to NULL in mnt_table_get_root_fs
2014-02-16 13:58 [PATCH] libmount: initialize *root to NULL in mnt_table_get_root_fs Thomas Bächler
@ 2014-02-17 12:37 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-02-17 12:37 UTC (permalink / raw)
To: Thomas Bächler; +Cc: util-linux
On Sun, Feb 16, 2014 at 02:58:06PM +0100, Thomas Bächler wrote:
> libmount/src/tab.c | 1 +
> 1 file changed, 1 insertion(+)
Applied with a small change, thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-17 12:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16 13:58 [PATCH] libmount: initialize *root to NULL in mnt_table_get_root_fs Thomas Bächler
2014-02-17 12:37 ` Karel Zak
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.