X-Git-Url: https://git.deb.at/?p=pkg%2Fnetris.git;a=blobdiff_plain;f=robot.c;h=23875a3bd4b9984bf0c1815e95e7970c5f8318e2;hp=cbd5cb22902a0a8cf91f9ea54e1584b20d2e869d;hb=6b1f6251013f5cf018e37ec7e67fe629a7f34455;hpb=da700cc38a5353b929f60a7ba2a1f19b5d640eb9 diff --git a/robot.c b/robot.c index cbd5cb2..23875a3 100644 --- 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)