From: Jilles Tjoelker Date: Tue, 6 Jan 2004 13:35:38 +0000 (+0000) Subject: Some fixes to simplemail. It appears to work for me now. X-Git-Tag: v1.6.1-roc-dev~591 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=7fab8e128df41da6c447252fbc3a8ef6582a26cd;p=dgamelaunch 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 --- diff --git a/dgamelaunch.c b/dgamelaunch.c index aad0335..4d523f2 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -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; } diff --git a/ttyplay.c b/ttyplay.c index 9a868fe..36e39d9 100644 --- a/ttyplay.c +++ b/ttyplay.c @@ -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;