-$Id: CHANGES,v 1.132 2001/08/16 09:37:57 stelian Exp $
+$Id: CHANGES,v 1.133 2001/08/16 13:12:30 stelian Exp $
Changes between versions 0.4b23 and 0.4b24 (released ?????????????)
===================================================================
whenever it needs operator attention. It should be
easier to use dump in scripts with this option.
+5. Detect the use of incompatible options to dump and
+ refuse them (like -a and -B options together).
+
Changes between versions 0.4b22 and 0.4b23 (released July 20, 2001)
===================================================================
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.57 2001/08/16 09:37:59 stelian Exp $";
+ "$Id: main.c,v 1.58 2001/08/16 13:12:30 stelian Exp $";
#endif /* not lint */
#include <config.h>
static void usage __P((void));
static void do_exclude_from_file __P((char *));
static void do_exclude_ino_str __P((char *));
+static void incompat_flags __P((int, char, char));
static dump_ino_t iexclude_list[IEXCLUDE_MAXNUM];/* the inode exclude list */
static int iexclude_num = 0; /* number of elements in the list */
register struct fstab *dt;
register char *map;
register int ch;
- int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1;
+ int i, anydirskipped;
+ int aflag = 0, bflag = 0, Tflag = 0, honorlevel = 1;
dump_ino_t maxino;
struct STAT statbuf;
dev_t filedev = 0;
case 'a': /* `auto-size', Write to EOM. */
unlimited = 1;
+ aflag = 1;
break;
case 'B': /* blocks per output file */
exit(X_STARTUP);
}
argc--;
- if (Tflag && uflag) {
- msg("You cannot use the T and u flags together.\n");
- msg("The ENTIRE dump is aborted.\n");
- exit(X_STARTUP);
- }
+ incompat_flags(Tflag && uflag, 'T', 'u');
+ incompat_flags(aflag && blocksperfile, 'a', 'B');
+ incompat_flags(aflag && cartridge, 'a', 'c');
+ incompat_flags(aflag && density, 'a', 'd');
+ incompat_flags(aflag && tsize, 'a', 's');
+
if (strcmp(tapeprefix, "-") == 0) {
pipeout++;
tapeprefix = "standard output";
}
fclose(f);
}
+
+static void incompat_flags(int cond, char flag1, char flag2) {
+ if (cond) {
+ msg("You cannot use the %c and %c flags together.\n",
+ flag1, flag2);
+ msg("The ENTIRE dump is aborted.\n");
+ exit(X_STARTUP);
+ }
+}