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-w32-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.gz
busybox-w32-298854f02963bd8e43dfeb7224d88cfeb0c932cb.tar.bz2
busybox-w32-298854f02963bd8e43dfeb7224d88cfeb0c932cb.zip
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 @@
62#define CMD_ALL 11 62#define CMD_ALL 11
63#define CMD_INFO 12 63#define CMD_INFO 12
64 64
65#ifdef BB_FBSET_FANCY 65#ifdef BB_FEATURE_FBSET_FANCY
66#define CMD_XRES 13 66#define CMD_XRES 13
67#define CMD_YRES 14 67#define CMD_YRES 14
68#define CMD_VXRES 15 68#define CMD_VXRES 15
@@ -105,7 +105,7 @@ struct cmdoptions_t {
105 "-vsync", 1, CMD_VSYNC}, { 105 "-vsync", 1, CMD_VSYNC}, {
106 "-laced", 1, CMD_LACED}, { 106 "-laced", 1, CMD_LACED}, {
107 "-double", 1, CMD_DOUBLE}, 107 "-double", 1, CMD_DOUBLE},
108#ifdef BB_FBSET_FANCY 108#ifdef BB_FEATURE_FBSET_FANCY
109 { 109 {
110 "--help", 0, CMD_HELP}, { 110 "--help", 0, CMD_HELP}, {
111 "-all", 0, CMD_ALL}, { 111 "-all", 0, CMD_ALL}, {
@@ -164,8 +164,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
164 } 164 }
165 } 165 }
166#else 166#else
167 fprintf(stderr, 167 errorMsg( "mode reading not compiled in\n");
168 "W: mode reading was disabled on this copy of fbset; ignoring request\n");
169#endif 168#endif
170 return 0; 169 return 0;
171} 170}
@@ -199,7 +198,7 @@ static void showmode(struct fb_var_screeninfo *v)
199 v->vsync_len); 198 v->vsync_len);
200 } 199 }
201 printf("\nmode \"%ux%u-%u\"\n", v->xres, v->yres, (int) (vrate + 0.5)); 200 printf("\nmode \"%ux%u-%u\"\n", v->xres, v->yres, (int) (vrate + 0.5));
202#ifdef BB_FBSET_FANCY 201#ifdef BB_FEATURE_FBSET_FANCY
203 printf("\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n", drate / 1e6, 202 printf("\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n", drate / 1e6,
204 hrate / 1e3, vrate); 203 hrate / 1e3, vrate);
205#endif 204#endif
@@ -283,7 +282,7 @@ extern int fbset_main(int argc, char **argv)
283 varset.hsync_len = strtoul(argv[6], 0, 0); 282 varset.hsync_len = strtoul(argv[6], 0, 0);
284 varset.vsync_len = strtoul(argv[7], 0, 0); 283 varset.vsync_len = strtoul(argv[7], 0, 0);
285 break; 284 break;
286#ifdef BB_FBSET_FANCY 285#ifdef BB_FEATURE_FBSET_FANCY
287 case CMD_XRES: 286 case CMD_XRES:
288 varset.xres = strtoul(argv[1], 0, 0); 287 varset.xres = strtoul(argv[1], 0, 0);
289 break; 288 break;
@@ -323,7 +322,8 @@ extern int fbset_main(int argc, char **argv)
323 if (ioctl(fh, FBIOPUT_VSCREENINFO, &var)) 322 if (ioctl(fh, FBIOPUT_VSCREENINFO, &var))
324 PERROR("fbset(ioctl)"); 323 PERROR("fbset(ioctl)");
325 showmode(&var); 324 showmode(&var);
326 close(fh); 325 /* Don't close the file, as exiting will take care of that */
326 /* close(fh); */
327 327
328 return (TRUE); 328 exit (TRUE);
329} 329}
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)
44 } 44 }
45 45
46 value = ioctl(fd, FDFLUSH, 0); 46 value = ioctl(fd, FDFLUSH, 0);
47 close(fd); 47 /* Don't bother closing. Exit does
48 * that, so we can save a few bytes */
49 /* close(fd); */
48 50
49 if (value) { 51 if (value) {
50 perror(*argv); 52 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)
55 if (ioctl(f, BLKFLSBUF) < 0) { 55 if (ioctl(f, BLKFLSBUF) < 0) {
56 fatalError( "freeramdisk: failed ioctl on %s: %s", rname, strerror(errno)); 56 fatalError( "freeramdisk: failed ioctl on %s: %s", rname, strerror(errno));
57 } 57 }
58 close(f); 58 /* Don't bother closing. Exit does
59 * that, so we can save a few bytes */
60 /* close(f); */
59 exit(TRUE); 61 exit(TRUE);
60} 62}
61 63
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)
1242 name_list[i] = xmalloc(sizeof(char) * PATH_MAX + 1); 1242 name_list[i] = xmalloc(sizeof(char) * PATH_MAX + 1);
1243} 1243}
1244 1244
1245#if 0
1245/* execute this atexit() to deallocate name_list[] */ 1246/* execute this atexit() to deallocate name_list[] */
1246/* piptigger was here */ 1247/* piptigger was here */
1247static void free_name_list(void) 1248static void free_name_list(void)
@@ -1257,6 +1258,7 @@ static void free_name_list(void)
1257 free(name_list); 1258 free(name_list);
1258 } 1259 }
1259} 1260}
1261#endif
1260 1262
1261extern int fsck_minix_main(int argc, char **argv) 1263extern int fsck_minix_main(int argc, char **argv)
1262{ 1264{
@@ -1265,7 +1267,9 @@ extern int fsck_minix_main(int argc, char **argv)
1265 int retcode = 0; 1267 int retcode = 0;
1266 1268
1267 alloc_name_list(); 1269 alloc_name_list();
1268 atexit(free_name_list); 1270 /* Don't bother to free memory. Exit does
1271 * that automagically, so we can save a few bytes */
1272 //atexit(free_name_list);
1269 1273
1270 if (argc && *argv) 1274 if (argc && *argv)
1271 program_name = *argv; 1275 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)
348 mntentlist[i].mnt_opts, mntentlist[i].mnt_freq, 348 mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
349 mntentlist[i].mnt_passno); 349 mntentlist[i].mnt_passno);
350 } 350 }
351 /* Don't bother to close files or free memory. Exit
352 * does that automagically, so we can save a few bytes */
353#if 0
351 free( mntentlist); 354 free( mntentlist);
352 close(fd); 355 close(fd);
356#endif
353 exit(TRUE); 357 exit(TRUE);
354 } 358 }
355#else 359#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)
145 return mp; 145 return mp;
146} 146}
147 147
148/* Don't bother to clean up, since exit() does that
149 * automagically, so we can save a few bytes */
150#if 0
148void mtab_free(void) 151void mtab_free(void)
149{ 152{
150 struct _mtab_entry_t *this, *next; 153 struct _mtab_entry_t *this, *next;
@@ -160,6 +163,7 @@ void mtab_free(void)
160 this = next; 163 this = next;
161 } 164 }
162} 165}
166#endif
163 167
164static int do_umount(const char *name, int useMtab) 168static int do_umount(const char *name, int useMtab)
165{ 169{