int uflag;
int vflag;
+int errors;
+
Arfile *astart, *amiddle, *aend; /* Temp file control block pointers */
int allobj = 1; /* set when all members are object files of the same type */
int symdefsize; /* size of symdef file */
}
argv++;
}
+ if (errors)
+ cp = "error";
exits(cp);
}
/*
}
bfile = Bopen(file, OREAD);
if (!bfile) {
- if (count != 0)
+ if (count != 0) {
fprint(2, "ar: cannot open %s\n", file);
+ errors++;
+ }
scanobj(&bar, ap, bp->size);
arcopy(&bar, ap, bp);
continue;
continue;
files[i] = 0;
bfile = Bopen(file, OREAD);
- if (!bfile)
- fprint(2, "ar: %s cannot open\n", file);
- else {
+ if (!bfile) {
+ fprint(2, "ar: cannot open %s\n", file);
+ errors++;
+ } else {
mesg('a', file);
d = dirfstat(Bfildes(bfile));
if (d == nil)
file = files[i];
files[i] = 0;
bfile = Bopen(file, OREAD);
- if(!bfile)
- fprint(2, "ar: %s cannot open\n", file);
- else {
+ if(!bfile) {
+ fprint(2, "ar: cannot open %s\n", file);
+ errors++;
+ } else {
mesg('q', file);
armove(bfile, 0, bp);
if (!arwrite(fd, bp))