]> skyeroc.xyz Git - dgamelaunch/commitdiff
Some fixes to simplemail. It appears to work for me now.
authorJilles Tjoelker <jilles@stack.nl>
Tue, 6 Jan 2004 13:35:38 +0000 (13:35 +0000)
committerJilles Tjoelker <jilles@stack.nl>
Tue, 6 Jan 2004 13:35:38 +0000 (13:35 +0000)
To keep it simple, 'm' quits out of watching.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@107 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c
ttyplay.c

index aad03355f9499796baf777e90b5392d8edbd1c89..4d523f223f85f929c2024cf214f2b1e48594aa10 100644 (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;
 }
 
index 9a868fea4d0a102ae7b8ef79bde3c42aa5dcd033..36e39d9ba0a377337a1d181cdbe1e5aa3c56fc9d 100644 (file)
--- 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;