- // llogin or other
- child_stdin = popen("llogin door -w -", "w");
- if( !child_stdin || child_stdin == (void*)-1 ) {
+ child_stdin = fdopen(child_stdin_fd, "w");
+ #endif
+
+ {
+ char buf[1024];
+ int len;
+ #if 0
+ if( giDoor_ChildStatus || (len = read(stdout_pair[0], buf, sizeof buf)) < 0)
+ #else
+ if( giDoor_ChildStatus || (len = read(child_stdin_fd, buf, sizeof buf)) < 0)
+ #endif
+ {
+ #if DEBUG
+ int child_exit;
+ waitpid(childPid, &child_exit, 0);
+ printf("Door_DoDispense: fread fail (child status %i)\n", child_exit);
+ #endif
+ return -1;
+ }
+ buf[len] = '\0';
+