Some fixes to simplemail. It appears to work for me now.

To keep it simple, 'm' quits out of watching.


git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@107 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Jilles Tjoelker 2004-01-06 13:35:38 +00:00
parent c250d038e9
commit 7fab8e128d
2 changed files with 12 additions and 5 deletions

View File

@ -664,13 +664,17 @@ domailuser (char *username)
fprintf (user_spool, "%s:%s\n", me->username, message);
fl.l_type = F_UNLCK;
if (fcntl (fileno (user_spool), F_SETLK, &fl) == -1)
mvaddstr (10, 1, "Couldn't unlock the file! Oh well.");
/*
* Don't unlock the file ourselves, this way it will be done automatically
* after all data has been written. (Using file locking with stdio is icky.)
*/
fclose (user_spool);
mvaddstr (9, 1, "Message sent successfully ");
refresh ();
sleep (2);
return;
}

View File

@ -209,8 +209,11 @@ ttypread (FILE * fp, Header * h, char **buf, int pread)
{
initncurses ();
domailuser (chosen_name);
/* XXX jilles: just quit out after mail for now */
#if 0
endwin ();
ttyplay_main (ttyfile_local, 1, 0);
ttyplay_main (ttyfile_local, 1, 0); /* ICK! Recursive */
#endif
return 0;
}
break;