summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fsck_minix.c6
-rw-r--r--util-linux/mount.c2
-rw-r--r--util-linux/umount.c5
3 files changed, 9 insertions, 4 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index c3c493f..f980fe9 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -1319,7 +1319,7 @@ static void alloc_name_list(void)
name_list[i] = xmalloc(sizeof(char) * BUFSIZ + 1);
}
-#if 0
+#ifdef BB_FEATURE_CLEAN_UP
/* execute this atexit() to deallocate name_list[] */
/* piptigger was here */
static void free_name_list(void)
@@ -1344,9 +1344,11 @@ extern int fsck_minix_main(int argc, char **argv)
int retcode = 0;
alloc_name_list();
+#ifdef BB_FEATURE_CLEAN_UP
/* Don't bother to free memory. Exit does
* that automagically, so we can save a few bytes */
- //atexit(free_name_list);
+ atexit(free_name_list);
+#endif
if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
die("bad inode size");
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 610d12d..6e95cdc 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -347,9 +347,9 @@ extern int mount_main(int argc, char **argv)
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
mntentlist[i].mnt_passno);
}
+#ifdef BB_FEATURE_CLEAN_UP
/* Don't bother to close files or free memory. Exit
* does that automagically, so we can save a few bytes */
-#if 0
free( mntentlist);
close(fd);
#endif
diff --git a/util-linux/umount.c b/util-linux/umount.c
index df075f7..6a5e4ca 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -142,7 +142,7 @@ char *mtab_next(void **iter)
/* Don't bother to clean up, since exit() does that
* automagically, so we can save a few bytes */
-#if 0
+#ifdef BB_FEATURE_CLEAN_UP
void mtab_free(void)
{
struct _mtab_entry_t *this, *next;
@@ -235,6 +235,9 @@ extern int umount_main(int argc, char **argv)
if (argc < 2) {
usage(umount_usage);
}
+#ifdef BB_FEATURE_CLEAN_UP
+ atexit(mtab_free);
+#endif
/* Parse any options */
while (--argc > 0 && **(++argv) == '-') {