diff options
Diffstat (limited to 'util-linux/umount.c')
-rw-r--r-- | util-linux/umount.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/util-linux/umount.c b/util-linux/umount.c index 0eade5a36..8565744f2 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -74,7 +74,7 @@ extern const char mtab_file[]; /* Defined in utility.c */ | |||
74 | * TODO: Perhaps switch to using Glibc's getmntent_r | 74 | * TODO: Perhaps switch to using Glibc's getmntent_r |
75 | * -Erik | 75 | * -Erik |
76 | */ | 76 | */ |
77 | void mtab_read(void) | 77 | static void mtab_read(void) |
78 | { | 78 | { |
79 | struct _mtab_entry_t *entry = NULL; | 79 | struct _mtab_entry_t *entry = NULL; |
80 | struct mntent *e; | 80 | struct mntent *e; |
@@ -97,7 +97,7 @@ void mtab_read(void) | |||
97 | endmntent(fp); | 97 | endmntent(fp); |
98 | } | 98 | } |
99 | 99 | ||
100 | char *mtab_getinfo(const char *match, const char which) | 100 | static char *mtab_getinfo(const char *match, const char which) |
101 | { | 101 | { |
102 | struct _mtab_entry_t *cur = mtab_cache; | 102 | struct _mtab_entry_t *cur = mtab_cache; |
103 | 103 | ||
@@ -111,8 +111,7 @@ char *mtab_getinfo(const char *match, const char which) | |||
111 | if (strcmp(cur->device, "/dev/root") == 0) { | 111 | if (strcmp(cur->device, "/dev/root") == 0) { |
112 | /* Adjusts device to be the real root device, | 112 | /* Adjusts device to be the real root device, |
113 | * or leaves device alone if it can't find it */ | 113 | * or leaves device alone if it can't find it */ |
114 | find_real_root_device_name( cur->device); | 114 | cur->device = find_real_root_device_name(cur->device); |
115 | return ( cur->device); | ||
116 | } | 115 | } |
117 | #endif | 116 | #endif |
118 | return cur->device; | 117 | return cur->device; |
@@ -123,18 +122,7 @@ char *mtab_getinfo(const char *match, const char which) | |||
123 | return NULL; | 122 | return NULL; |
124 | } | 123 | } |
125 | 124 | ||
126 | char *mtab_first(void **iter) | 125 | static char *mtab_next(void **iter) |
127 | { | ||
128 | struct _mtab_entry_t *mtab_iter; | ||
129 | |||
130 | if (!iter) | ||
131 | return NULL; | ||
132 | mtab_iter = mtab_cache; | ||
133 | *iter = (void *) mtab_iter; | ||
134 | return mtab_next(iter); | ||
135 | } | ||
136 | |||
137 | char *mtab_next(void **iter) | ||
138 | { | 126 | { |
139 | char *mp; | 127 | char *mp; |
140 | 128 | ||
@@ -145,10 +133,21 @@ char *mtab_next(void **iter) | |||
145 | return mp; | 133 | return mp; |
146 | } | 134 | } |
147 | 135 | ||
136 | static char *mtab_first(void **iter) | ||
137 | { | ||
138 | struct _mtab_entry_t *mtab_iter; | ||
139 | |||
140 | if (!iter) | ||
141 | return NULL; | ||
142 | mtab_iter = mtab_cache; | ||
143 | *iter = (void *) mtab_iter; | ||
144 | return mtab_next(iter); | ||
145 | } | ||
146 | |||
148 | /* Don't bother to clean up, since exit() does that | 147 | /* Don't bother to clean up, since exit() does that |
149 | * automagically, so we can save a few bytes */ | 148 | * automagically, so we can save a few bytes */ |
150 | #ifdef BB_FEATURE_CLEAN_UP | 149 | #ifdef BB_FEATURE_CLEAN_UP |
151 | void mtab_free(void) | 150 | static void mtab_free(void) |
152 | { | 151 | { |
153 | struct _mtab_entry_t *this, *next; | 152 | struct _mtab_entry_t *this, *next; |
154 | 153 | ||