- cpydata(tmpfd, fd, tmpfil, file);
- close(tmpfd);
- unlink(tmpfil);
- } else {
- strncpy(buffer, m_backup(file), sizeof(buffer));
- if (rename(file, buffer) == NOTOK) {
- switch (errno) {
- case ENOENT: /* unlinked early - no annotations */
- unlink(tmpfil);
- break;
+ if (delete >= -1 && ftruncate(fd, 0) == -1)
+ adios(tmpfil, "unable to truncate.");