# | Line 630 | Line 630 | initambfile( /* initialize ambient file */ | |
---|---|---|
630 | { | |
631 | extern char *progname, *octname; | |
632 | static char *mybuf = NULL; | |
633 | + | int ntries = 3; |
634 | ||
635 | #ifdef F_SETLKW | |
636 | aflock(cre8 ? F_WRLCK : F_RDLCK); | |
# | Line 665 | Line 666 | retry: | |
666 | fputc('\n', ambfp); | |
667 | putambmagic(ambfp); | |
668 | } else if (getheader(ambfp, amb_headline, NULL) < 0 || !hasambmagic(ambfp)) { | |
669 | < | int ntries = 2; |
669 | < | if (ntries-- > 0 && ftell(ambfp) == 0) { |
669 | > | if (--ntries > 0 && ftell(ambfp) == 0) { |
670 | #ifdef F_SETLKW | |
671 | aflock(F_UNLCK); | |
672 | clearerr(ambfp); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |