]> git.pond.sub.org Git - empserver/blobdiff - src/lib/player/recvclient.c
Indented with src/scripts/indent-emp.
[empserver] / src / lib / player / recvclient.c
index fa8baa5339c1c0148b55fb311ef6f56bcc203a30..e5a6dbc8c528a7d92f774f7dde7069dc9f50e3f5 100644 (file)
 int
 recvclient(s_char *cmd, int size)
 {
-       extern  int errno;
-       int     count;
+    extern int errno;
+    int count;
 
-       if (player->aborted)
-               return -2; 
-       count = io_gets(player->iop, cmd, size);
-       while (!player->aborted && count < 0) {
-               io_output_all(player->iop);
-               io_input(player->iop, IO_WAIT);
-               if (io_error(player->iop))
-                       player->aborted++;
-               else if (io_eof(player->iop))
-                       return -1;
-               else
-                       count = io_gets(player->iop, cmd, size);
-       }
-       if (count > 0) {
-               if (strcmp(cmd, "ctld") == 0)
-                       return -1;
-               if (strcmp(cmd, "aborted") == 0)
-                       player->aborted = 1;
-       }
-       if (player->aborted)
-               return -2;
-       return count;
+    if (player->aborted)
+       return -2;
+    count = io_gets(player->iop, cmd, size);
+    while (!player->aborted && count < 0) {
+       io_output_all(player->iop);
+       io_input(player->iop, IO_WAIT);
+       if (io_error(player->iop))
+           player->aborted++;
+       else if (io_eof(player->iop))
+           return -1;
+       else
+           count = io_gets(player->iop, cmd, size);
+    }
+    if (count > 0) {
+       if (strcmp(cmd, "ctld") == 0)
+           return -1;
+       if (strcmp(cmd, "aborted") == 0)
+           player->aborted = 1;
+    }
+    if (player->aborted)
+       return -2;
+    return count;
 }