]> skyeroc.xyz Git - dgamelaunch/commitdiff
Shouldn't exit out of dgl while watching ttyrecs.
authorPasi Kallinen <paxed@alt.org>
Wed, 5 May 2010 11:32:37 +0000 (11:32 +0000)
committerPasi Kallinen <paxed@alt.org>
Wed, 5 May 2010 11:32:37 +0000 (11:32 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@551 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

ttyplay.c

index 99aa70a85a7455bebd4a1f84412acfec87077d33..6c3b043a7493148dab2a480dafd07386d3ff9794 100644 (file)
--- a/ttyplay.c
+++ b/ttyplay.c
@@ -144,6 +144,7 @@ ttyplay_keyboard_action(int c)
     struct termios t;
     switch (c)
     {
+    case ERR:
     case 'q':
         return READ_QUIT;
     case 'r':
@@ -213,14 +214,14 @@ ttyread (FILE * fp, Header * h, char **buf, int pread)
     {
       fprintf (stderr, "h->len too big (%ld) limit %ld\n",
                      (long)h->len, (long)BUFSIZ);
-      exit (-21);
+      return READ_QUIT;
     }
 
   *buf = malloc (h->len + 1);
   if (*buf == NULL)
     {
       perror ("malloc");
-      exit (-22);
+      return READ_QUIT;
     }
 
   if (fread (*buf, 1, h->len, fp) != h->len)
@@ -253,7 +254,7 @@ ttypread (FILE * fp, Header * h, char **buf, int pread)
   if (kq == -1)
     {
       printf ("kqueue() failed.\n");
-      exit (1);
+      return READ_QUIT;
     }
 #endif
 
@@ -299,7 +300,7 @@ ttypread (FILE * fp, Header * h, char **buf, int pread)
             */
            endwin ();
            printf ("Exiting due to 20 minutes of inactivity.\n");
-           exit (-23);
+           return READ_QUIT;
          }
        FD_ZERO (&readfs);
        FD_SET (STDIN_FILENO, &readfs);
@@ -314,7 +315,7 @@ ttypread (FILE * fp, Header * h, char **buf, int pread)
                return READ_RESTART;
            } else {
                printf("select()/kevent() failed.\n");
-               exit (1);
+               return READ_QUIT;
            }
        }
       if (doread)