Lines Matching refs:rc
158 int rc, nfds; in kwboot_tty_recv() local
163 rc = -1; in kwboot_tty_recv()
192 rc = 0; in kwboot_tty_recv()
194 return rc; in kwboot_tty_recv()
200 int rc; in kwboot_tty_send() local
206 rc = -1; in kwboot_tty_send()
217 rc = tcdrain(fd); in kwboot_tty_send()
219 return rc; in kwboot_tty_send()
250 int rc, fd; in kwboot_open_tty() local
253 rc = -1; in kwboot_open_tty()
270 rc = tcsetattr(fd, TCSANOW, &tio); in kwboot_open_tty()
271 if (rc) in kwboot_open_tty()
274 rc = fd; in kwboot_open_tty()
276 if (rc < 0) { in kwboot_open_tty()
281 return rc; in kwboot_open_tty()
287 int rc; in kwboot_bootmsg() local
297 rc = tcflush(tty, TCIOFLUSH); in kwboot_bootmsg()
298 if (rc) in kwboot_bootmsg()
302 rc = kwboot_tty_send(tty, msg, 8); in kwboot_bootmsg()
303 if (rc) { in kwboot_bootmsg()
309 rc = kwboot_tty_recv(tty, &c, 1, msg_rsp_timeo); in kwboot_bootmsg()
313 } while (rc || c != NAK); in kwboot_bootmsg()
317 return rc; in kwboot_bootmsg()
323 int rc; in kwboot_debugmsg() local
330 rc = tcflush(tty, TCIOFLUSH); in kwboot_debugmsg()
331 if (rc) in kwboot_debugmsg()
334 rc = kwboot_tty_send(tty, msg, 8); in kwboot_debugmsg()
335 if (rc) { in kwboot_debugmsg()
340 rc = kwboot_tty_recv(tty, buf, 16, msg_rsp_timeo); in kwboot_debugmsg()
344 } while (rc); in kwboot_debugmsg()
348 return rc; in kwboot_debugmsg()
377 int rc, retries; in kwboot_xm_sendblock() local
382 rc = kwboot_tty_send(fd, block, sizeof(*block)); in kwboot_xm_sendblock()
383 if (rc) in kwboot_xm_sendblock()
387 rc = kwboot_tty_recv(fd, &c, 1, blk_rsp_timeo); in kwboot_xm_sendblock()
388 if (rc) in kwboot_xm_sendblock()
401 rc = -1; in kwboot_xm_sendblock()
405 rc = 0; in kwboot_xm_sendblock()
418 return rc; in kwboot_xm_sendblock()
425 int rc, pnum, N, err; in kwboot_xmodem() local
448 rc = kwboot_xm_sendblock(tty, &block); in kwboot_xmodem()
449 if (rc) in kwboot_xmodem()
456 rc = kwboot_tty_send_char(tty, EOT); in kwboot_xmodem()
459 return rc; in kwboot_xmodem()
511 int rc, in, s; in kwboot_terminal() local
515 rc = -1; in kwboot_terminal()
519 rc = tcgetattr(in, &otio); in kwboot_terminal()
520 if (!rc) { in kwboot_terminal()
523 rc = tcsetattr(in, TCSANOW, &tio); in kwboot_terminal()
525 if (rc) { in kwboot_terminal()
535 rc = 0; in kwboot_terminal()
555 rc = kwboot_term_pipe(tty, STDOUT_FILENO, NULL, NULL); in kwboot_terminal()
556 if (rc) in kwboot_terminal()
561 rc = kwboot_term_pipe(in, tty, quit, &s); in kwboot_terminal()
562 if (rc) in kwboot_terminal()
569 return rc; in kwboot_terminal()
575 int rc, fd, flags; in kwboot_mmap_image() local
579 rc = -1; in kwboot_mmap_image()
586 rc = fstat(fd, &st); in kwboot_mmap_image()
587 if (rc) in kwboot_mmap_image()
598 rc = 0; in kwboot_mmap_image()
601 if (rc && img) { in kwboot_mmap_image()
625 int rc; in kwboot_img_patch_hdr() local
631 rc = -1; in kwboot_img_patch_hdr()
658 rc = 0; in kwboot_img_patch_hdr()
677 rc = 0; in kwboot_img_patch_hdr()
679 return rc; in kwboot_img_patch_hdr()
711 int rv, rc, tty, term, prot, patch; in main() local
817 rc = kwboot_img_patch_hdr(img, size); in main()
818 if (rc) { in main()
825 rc = kwboot_debugmsg(tty, debugmsg); in main()
826 if (rc) { in main()
831 rc = kwboot_bootmsg(tty, bootmsg); in main()
832 if (rc) { in main()
839 rc = kwboot_xmodem(tty, img, size); in main()
840 if (rc) { in main()
847 rc = kwboot_terminal(tty); in main()
848 if (rc && !(errno == EINTR)) { in main()