X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b56c88e2847c582f9b18ae5bbda44f033cd49c42..dd740c4e3e407d8dba7884bb599c1f5a588b05e9:/uip/msh.c?ds=inline diff --git a/uip/msh.c b/uip/msh.c index fbfb408e..86855a4f 100644 --- a/uip/msh.c +++ b/uip/msh.c @@ -1079,6 +1079,7 @@ quit (void) char map1[BUFSIZ], map2[BUFSIZ]; struct stat st; FILE *dp; + int failed_to_lock = 0; if (!(mp->msgflags & MODIFIED) || is_readonly(mp) || fmsh) { if (vmh) @@ -1089,7 +1090,7 @@ quit (void) if (vmh) ttyNaux (NULLCMD, "FAST"); cp = NULL; - if ((dp = lkfopendata (mp->foldpath, "r")) == NULL) { + if ((dp = lkfopendata (mp->foldpath, "r", &failed_to_lock)) == NULL) { advise (mp->foldpath, "unable to lock"); if (vmh) { ttyR (NULLCMD); @@ -1114,7 +1115,7 @@ quit (void) close (i); else advise (mp->foldpath, "error zero'ing"); - unlink (map_name (mp->foldpath));/* XXX */ + (void) m_unlink (map_name (mp->foldpath));/* XXX */ } goto release; } @@ -1131,8 +1132,8 @@ quit (void) for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) if (does_exist(mp, msgnum) && pack (tmpfil, md, msgnum) == NOTOK) { mbx_close (tmpfil, md); - unlink (tmpfil); - unlink (map_name (tmpfil)); + (void) m_unlink (tmpfil); + (void) m_unlink (map_name (tmpfil)); goto release; } mbx_close (tmpfil, md); @@ -1145,8 +1146,8 @@ quit (void) if (rename (map1, map2) == NOTOK) { admonish (map2, "unable to rename %s to", map1); - unlink (map1); - unlink (map2); + (void) m_unlink (map1); + (void) m_unlink (map2); } }