Lines Matching refs:mbfd
978 int mbfd = -1, nr = 0, nw, off;
1136 mbfd = open(path, O_APPEND|O_CREAT|O_EXCL|O_WRONLY,
1147 if (mbfd < 0)
1157 else if (fchown(mbfd, user.mbdb_uid, gid) < 0)
1173 (void) close(mbfd);
1174 mbfd = -1;
1206 mbfd = open(path, O_APPEND|O_WRONLY, 0);
1207 if (mbfd < 0)
1212 else if (fstat(mbfd, &fsb) < 0 ||
1268 if (flock(mbfd, LOCK_EX) < 0)
1275 curoff = lseek(mbfd, (off_t) 0, SEEK_END);
1317 if ((nw = write(mbfd, buf + off, nr - off)) < 0)
1338 if (fsync(mbfd) < 0)
1345 if (mbfd >= 0)
1346 (void) ftruncate(mbfd, curoff);
1347 err1: if (mbfd >= 0)
1348 (void) close(mbfd);
1363 if (fstat(mbfd, &sb) < 0)
1370 if (close(mbfd))
1378 mbfd = open(path, O_WRONLY, 0);
1379 if (mbfd < 0 ||
1381 || flock(mbfd, LOCK_EX) < 0 ||
1382 fstat(mbfd, &sb) < 0 ||
1395 if (mbfd >= 0)
1397 (void) close(mbfd);
1398 mbfd = -1;