Lines Matching refs:histfd
68 static int histfd = -1; variable
542 if (histfd != -1) { in sethistfile()
544 (void)close(histfd); in sethistfile()
545 histfd = -1; in sethistfile()
587 if (histfd != -1) { in histsync()
652 if (svmode == HIST_STORE && histfd != -1) in histsave()
729 lseek(histfd, (off_t)0, SEEK_SET) < 0) in hist_persist_back()
749 if ((w = write(histfd, cp, n)) != -1) { in hist_persist_back()
762 if (ftruncate(histfd, tot)) { in hist_persist_back()
788 if ((histfd = savefd(fd)) < 0) in hist_persist_init()
790 if (histfd != fd) in hist_persist_init()
793 mksh_lockfd(histfd); in hist_persist_init()
795 histfsize = lseek(histfd, (off_t)0, SEEK_END); in hist_persist_init()
802 MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); in hist_persist_init()
826 if (fstat(histfd, &sb) >= 0 && in hist_persist_init()
876 if (write(histfd, sprinkle, 2) != 2) { in hist_persist_init()
882 if ((histfsize = lseek(histfd, (off_t)0, SEEK_END)) < 0) in hist_persist_init()
885 mksh_unlkfd(histfd); in hist_persist_init()
965 mksh_lockfd(histfd); in writehistfile()
966 if ((sizenow = lseek(histfd, (off_t)0, SEEK_END)) < 0) in writehistfile()
983 MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); in writehistfile()
998 if (cmd && !writehistline(histfd, lno, cmd)) { in writehistfile()
1003 if ((histfsize = lseek(histfd, (off_t)0, SEEK_END)) < 0) in writehistfile()
1005 mksh_unlkfd(histfd); in writehistfile()
1026 if (histfd >= 0) { in hist_finish()
1027 mksh_unlkfd(histfd); in hist_finish()
1028 (void)close(histfd); in hist_finish()
1030 histfd = -1; in hist_finish()