-
- child_stdin = fdopen(stdin_pair[1], "w");
- close(stdin_pair[0]); // child stdin read
- close(stdout_pair[1]); // child stdout write
-
- #else
- // llogin or other
- child_stdin = popen("llogin door -w -", "w");
- if( !child_stdin || child_stdin == (void*)-1 ) {
- #if DEBUG
- printf("Door_DoDispense: llogin failure\n");
- #endif
- return -1;
- }
- #endif
-
- if(fread(buf, 1, 512, child_stdin) == 0) return -1;
-
- // Send password
- if( fputs(gsDoor_Password, child_stdin) <= 0 ) return -1;
- fputs("\n", child_stdin);
-
-
- #if DEBUG
- printf("Door_DoDispense: Door unlock\n");
- #endif
-
- // ATH1 - Unlock door
- if( fputs("ATH1\n", child_stdin) <= 0) return -1;
-
- // Wait before re-locking
- sleep(DOOR_UNLOCKED_DELAY);