* multiple partitions. If so, return a regular expression that matches
* partitions for that device, otherwise return 0.
*/
-static char *multiple_partitions(const char *name) {
+static char *multiple_partitions(const char *name)
+{
int i = 0;
int status;
regex_t preg;
/* handle -x option */
-void handle_x_option(char *deviceName) {
- int fd; /* file descriptor for device */
+void set_device_speed(char *name)
+{
+ int fd;
+
if (x_option) {
- if (v_option)
- {
+ if (v_option) {
if (x_arg == 0)
printf(_("%s: setting CD-ROM speed to auto\n"),
program_invocation_short_name);
program_invocation_short_name,
x_arg);
}
- fd = open_device(deviceName);
+ fd = open_device(name);
select_speed(fd, x_arg);
- exit(0);
+ exit(EXIT_SUCCESS);
}
}
printf(_("%s: closing tray\n"), programName);
fd = open_device(deviceName);
close_tray(fd);
- handle_x_option(deviceName);
+ set_device_speed(deviceName);
exit(0);
}
printf(_("%s: toggling tray\n"), programName);
fd = open_device(deviceName);
toggle_tray(fd);
- handle_x_option(deviceName);
+ set_device_speed(deviceName);
exit(0);
}
/* handle -x option only */
- if (!c_option) handle_x_option(deviceName);
+ if (!c_option)
+ set_device_speed(deviceName);
/* unmount device if mounted */
if ((m_option != 1) && mounted) {
printf(_("%s: selecting CD-ROM disc #%ld\n"), programName, c_arg);
fd = open_device(deviceName);
changer_select(fd, c_arg);
- handle_x_option(deviceName);
+ set_device_speed(deviceName);
exit(0);
}