--- aumix-2.7/src/common.c.save_load Mon Jun 25 22:08:22 2001 +++ aumix-2.7/src/common.c Mon Jun 25 22:16:30 2001 @@ -114,6 +114,7 @@ int main(int argc, char *argv[]) { int optn, i; + int save = 0, load = 0; #ifdef HAVE_CURSES int setcolors = FALSE; #endif /* HAVE_CURSES */ @@ -169,14 +170,10 @@ break; #endif /* HAVE_CURSES */ case 'S': /* Save to file. */ - if (mixer_fd == -1) - ErrorExitWarn(InitializeMixer(device_filename), 'e'); - ErrorExitWarn(SaveSettings(), 'e'); + save = 1; break; case 'L': /* Load from file. */ - if (mixer_fd == -1) - ErrorExitWarn(InitializeMixer(device_filename), 'e'); - ErrorExitWarn(LoadSettings(), 'e'); + load = 1; break; #if defined (HAVE_CURSES) || defined (HAVE_GTK) case 'I': /* User asked for interactive mode. */ @@ -192,6 +189,17 @@ } } } + if (save | load) { + if (mixer_fd == -1) + ErrorExitWarn(InitializeMixer(device_filename), 'e'); + if (save) + ErrorExitWarn(SaveSettings(), 'e'); + else + ErrorExitWarn(LoadSettings(), 'e'); + close(mixer_fd); + exit(EXIT_SUCCESS); + } + #if defined (HAVE_CURSES) || defined (HAVE_GTK) /* Be interactive if no options were given. */ if (!interactive && argc <= 1)