+char *ReadStatus(int FD)
+{
+ char tmpbuf[32];
+ int len;
+ len = read(FD, tmpbuf, sizeof(tmpbuf)-1);
+ tmpbuf[len] = 0;
+ char *msg = strchr(tmpbuf, ',');
+ if( !msg ) {
+ fprintf(stderr, "Door returned malformed data (no ',')\n");
+ return NULL;
+ }
+ msg ++;
+ char *end = strchr(tmpbuf, ';');
+ if( !end ) {
+ fprintf(stderr, "Door returned malformed data (no ';')\n");
+ return NULL;
+ }
+ *end = '\0';
+
+ return strdup(msg);
+}