aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-02-28 04:45:24 +0000
committerRob Landley <rob@landley.net>2006-02-28 04:45:24 +0000
commit2fe4eac4ea355cfc5e85bc3acf50d26b86146a2c (patch)
tree09f332189f5012be34ffa5d6c8b63ca2c4070c41
parente813ddba18d5f619fc406a7ff6551ec470552144 (diff)
downloadbusybox-w32-2fe4eac4ea355cfc5e85bc3acf50d26b86146a2c.tar.gz
busybox-w32-2fe4eac4ea355cfc5e85bc3acf50d26b86146a2c.tar.bz2
busybox-w32-2fe4eac4ea355cfc5e85bc3acf50d26b86146a2c.zip
Cosmetic cleanup from tito.
-rw-r--r--miscutils/eject.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/miscutils/eject.c b/miscutils/eject.c
index 511d8b204..2643f36d5 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -2,20 +2,9 @@
2 * eject implementation for busybox 2 * eject implementation for busybox
3 * 3 *
4 * Copyright (C) 2004 Peter Willis <psyphreak@phreaker.net> 4 * Copyright (C) 2004 Peter Willis <psyphreak@phreaker.net>
5 * Copyright (C) 2005 Tito Ragusa <farmatito@tiscali.it>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 8 *
20 */ 9 */
21 10
@@ -43,17 +32,18 @@ extern int eject_main(int argc, char **argv)
43 struct mntent *m; 32 struct mntent *m;
44 33
45 flags = bb_getopt_ulflags(argc, argv, "t"); 34 flags = bb_getopt_ulflags(argc, argv, "t");
46 device=argv[optind] ? : DEFAULT_CDROM; 35 device = argv[optind] ? : DEFAULT_CDROM;
47 36
48 if((m = find_mount_point(device, bb_path_mtab_file))) { 37 if ((m = find_mount_point(device, bb_path_mtab_file))) {
49 if(umount(m->mnt_dir)) 38 if (umount(m->mnt_dir)) {
50 bb_error_msg_and_die("Can't umount"); 39 bb_error_msg_and_die("Can't umount");
51 else if(ENABLE_FEATURE_MTAB_SUPPORT) erase_mtab(m->mnt_fsname); 40 } else if (ENABLE_FEATURE_MTAB_SUPPORT) {
41 erase_mtab(m->mnt_fsname);
42 }
52 } 43 }
53 if (ioctl(bb_xopen( device, (O_RDONLY | O_NONBLOCK)), 44 if (ioctl(bb_xopen(device, (O_RDONLY | O_NONBLOCK)),
54 ( flags ? CDROMCLOSETRAY : CDROMEJECT))) 45 (flags ? CDROMCLOSETRAY : CDROMEJECT))) {
55 {
56 bb_perror_msg_and_die(device); 46 bb_perror_msg_and_die(device);
57 } 47 }
58 return(EXIT_SUCCESS); 48 return (EXIT_SUCCESS);
59} 49}