aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-23 01:09:18 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-23 01:09:18 +0000
commit298854f02963bd8e43dfeb7224d88cfeb0c932cb (patch)
tree7a2fbb55e55f980edddb0d627c3f3e79c8f793b0 /util-linux
parentec5bd90916b6e815a36c14ac04d1b78e3e487400 (diff)
downloadbusybox-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.gz
My latest ramblings.
-Erik
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fbset.c16
-rw-r--r--util-linux/fdflush.c4
-rw-r--r--util-linux/freeramdisk.c4
-rw-r--r--util-linux/fsck_minix.c6
-rw-r--r--util-linux/mount.c4
-rw-r--r--util-linux/umount.c4
6 files changed, 27 insertions, 11 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index a75e431db..7ca41733b 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -62,7 +62,7 @@
#define CMD_ALL 11
#define CMD_INFO 12
-#ifdef BB_FBSET_FANCY
+#ifdef BB_FEATURE_FBSET_FANCY
#define CMD_XRES 13
#define CMD_YRES 14
#define CMD_VXRES 15
@@ -105,7 +105,7 @@ struct cmdoptions_t {
"-vsync", 1, CMD_VSYNC}, {
"-laced", 1, CMD_LACED}, {
"-double", 1, CMD_DOUBLE},
-#ifdef BB_FBSET_FANCY
+#ifdef BB_FEATURE_FBSET_FANCY
{
"--help", 0, CMD_HELP}, {
"-all", 0, CMD_ALL}, {
@@ -164,8 +164,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
}
}
#else
- fprintf(stderr,
- "W: mode reading was disabled on this copy of fbset; ignoring request\n");
+ errorMsg( "mode reading not compiled in\n");
#endif
return 0;
}
@@ -199,7 +198,7 @@ static void showmode(struct fb_var_screeninfo *v)
v->vsync_len);
}
printf("\nmode \"%ux%u-%u\"\n", v->xres, v->yres, (int) (vrate + 0.5));
-#ifdef BB_FBSET_FANCY
+#ifdef BB_FEATURE_FBSET_FANCY
printf("\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n", drate / 1e6,
hrate / 1e3, vrate);
#endif
@@ -283,7 +282,7 @@ extern int fbset_main(int argc, char **argv)
varset.hsync_len = strtoul(argv[6], 0, 0);
varset.vsync_len = strtoul(argv[7], 0, 0);
break;
-#ifdef BB_FBSET_FANCY
+#ifdef BB_FEATURE_FBSET_FANCY
case CMD_XRES:
varset.xres = strtoul(argv[1], 0, 0);
break;
@@ -323,7 +322,8 @@ extern int fbset_main(int argc, char **argv)
if (ioctl(fh, FBIOPUT_VSCREENINFO, &var))
PERROR("fbset(ioctl)");
showmode(&var);
- close(fh);
+ /* Don't close the file, as exiting will take care of that */
+ /* close(fh); */
- return (TRUE);
+ exit (TRUE);
}
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index 0b154c8a6..201cea898 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -44,7 +44,9 @@ extern int fdflush_main(int argc, char **argv)
}
value = ioctl(fd, FDFLUSH, 0);
- close(fd);
+ /* Don't bother closing. Exit does
+ * that, so we can save a few bytes */
+ /* close(fd); */
if (value) {
perror(*argv);
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 43d42d424..06937a70f 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -55,7 +55,9 @@ freeramdisk_main(int argc, char **argv)
if (ioctl(f, BLKFLSBUF) < 0) {
fatalError( "freeramdisk: failed ioctl on %s: %s", rname, strerror(errno));
}
- close(f);
+ /* Don't bother closing. Exit does
+ * that, so we can save a few bytes */
+ /* close(f); */
exit(TRUE);
}
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 47e81ce42..aa0a82432 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -1242,6 +1242,7 @@ static void alloc_name_list(void)
name_list[i] = xmalloc(sizeof(char) * PATH_MAX + 1);
}
+#if 0
/* execute this atexit() to deallocate name_list[] */
/* piptigger was here */
static void free_name_list(void)
@@ -1257,6 +1258,7 @@ static void free_name_list(void)
free(name_list);
}
}
+#endif
extern int fsck_minix_main(int argc, char **argv)
{
@@ -1265,7 +1267,9 @@ extern int fsck_minix_main(int argc, char **argv)
int retcode = 0;
alloc_name_list();
- atexit(free_name_list);
+ /* Don't bother to free memory. Exit does
+ * that automagically, so we can save a few bytes */
+ //atexit(free_name_list);
if (argc && *argv)
program_name = *argv;
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 03891371a..30a060fc1 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -348,8 +348,12 @@ extern int mount_main(int argc, char **argv)
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
mntentlist[i].mnt_passno);
}
+ /* 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
exit(TRUE);
}
#else
diff --git a/util-linux/umount.c b/util-linux/umount.c
index c34bf5fc3..23973fc85 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -145,6 +145,9 @@ char *mtab_next(void **iter)
return mp;
}
+/* Don't bother to clean up, since exit() does that
+ * automagically, so we can save a few bytes */
+#if 0
void mtab_free(void)
{
struct _mtab_entry_t *this, *next;
@@ -160,6 +163,7 @@ void mtab_free(void)
this = next;
}
}
+#endif
static int do_umount(const char *name, int useMtab)
{