int ftmp;
int ntry = 1000; // that should be a lot!
do {
- seqnum = NEXTSEQNUM(seqnum);
qfile = fxStr::format(FAX_RECVDIR "/fax%05u.tif", seqnum);
ftmp = Sys::open(qfile, O_RDWR|O_CREAT|O_EXCL, recvFileMode);
+ seqnum = NEXTSEQNUM(seqnum); // Increment _after_ attempting to open
} while (ftmp < 0 && errno == EEXIST && --ntry >= 0);
if (ftmp >= 0) {
/*
int ftmp;
int ntry = 1000; // that should be a lot!
do {
- seqnum = NEXTSEQNUM(seqnum);
commid = fxStr::format("%08u", seqnum);
fxStr file = FAX_LOGDIR "/c" | commid;
ftmp = Sys::open(file, O_RDWR|O_CREAT|O_EXCL, logMode);
+ seqnum = NEXTSEQNUM(seqnum); // Increment _after_ attempting to open
} while (ftmp < 0 && errno == EEXIST && --ntry >= 0);
umask(omask);
if (ftmp >= 0) {