]> git.deb.at Git - pkg/netris.git/blobdiff - robot.c
Imported Debian patch 0.52-7
[pkg/netris.git] / robot.c
diff --git a/robot.c b/robot.c
index cbd5cb22902a0a8cf91f9ea54e1584b20d2e869d..23875a3bd4b9984bf0c1815e95e7970c5f8318e2 100644 (file)
--- a/robot.c
+++ b/robot.c
@@ -35,7 +35,7 @@ static EventGenRec robotGen =
                { NULL, 0, FT_read, -1, RobotGenFunc, EM_robot };
 
 static int robotProcess;
-static FILE *toRobot = NULL;
+static FILE *toRobot;
 static int toRobotFd, fromRobotFd;
 
 static char robotBuf[128];
@@ -112,13 +112,10 @@ ExtFunc void RobotTimeStamp(void)
 ExtFunc void CloseRobot(void)
 {
        RemoveEventGen(&robotGen);
-       if(toRobot) {
-               if (robotProcess > 0)
-                       RobotCmd(1, "Exit\n");
-               fclose(toRobot);
-               close(fromRobotFd);
-               toRobot = NULL;
-       }
+       if (robotProcess > 0)
+               RobotCmd(1, "Exit\n");
+       fclose(toRobot);
+       close(fromRobotFd);
 }
 
 static MyEventType RobotGenFunc(EventGenRec *gen, MyEvent *event)