Changeset 1556
- Timestamp:
- Apr 26, 2016, 5:15:04 PM (9 years ago)
- Location:
- cups/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cups/trunk/cgi-bin/var.c ¶
r1554 r1556 779 779 while (fgets(line, sizeof(line), stdin)) 780 780 { 781 #ifdef __OS2__782 if (!strcmp(line, "\r\n") || !strcmp(line, "\n"))783 #else784 781 if (!strcmp(line, "\r\n")) 785 #endif786 782 { 787 783 /* … … 828 824 ptr = line; 829 825 830 #ifdef __OS2__831 while ((ch = getchar()) != EOF && ch != '\n')832 #else833 826 while ((ch = getchar()) != EOF) 834 #endif835 827 { 836 828 *ptr++ = (char)ch; … … 873 865 end = line + sizeof(line) - 1; 874 866 875 #ifdef __OS2__876 while ((ch = getchar()) != EOF && ch != '\n')877 #else878 867 while ((ch = getchar()) != EOF) 879 #endif880 868 { 881 869 if (ptr < end) -
TabularUnified cups/trunk/scheduler/client.c ¶
r1358 r1556 2110 2110 if (con->filename) 2111 2111 { 2112 #ifdef __OS2__ 2113 fd = open(con->filename, O_RDONLY | O_BINARY); 2114 #else 2112 2115 fd = open(con->filename, O_RDONLY); 2116 #endif 2113 2117 2114 2118 if (fd < 0) -
TabularUnified cups/trunk/scheduler/select.c ¶
r1365 r1556 618 618 NULL); 619 619 620 #if 0 // #ifdef __EMX__ // @todo I doubt this part is needed 621 /* libc's select() is flaky - pause 0.5 second and retry */ 622 if (nfds == -1) { 620 #ifdef __OS2__ 621 /* libc's select() is flaky - pause 0.5 second and retry 622 * @todo see why this is really needed 623 * my findings are, that it's only needed when gutenprint is installed 624 * somehow a cupsdPipeCommand needs very long to fork() execv() and so 625 * the socket isn't ready */ 626 if (nfds == -1) 627 { 628 cupsdLogMessage(CUPSD_LOG_WARN, "cupsdDoSelect: select() returned %d... pause and retry select()", 629 nfds); 623 630 usleep(500000); 624 cupsdLogMessage(CUPSD_LOG_INFO, "cupsdDoSelect: select() returned %d... pause and retry select()", 631 if (timeout >= 0 && timeout < 86400) 632 { 633 stimeout.tv_sec = timeout; 634 stimeout.tv_usec = 0; 635 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 636 &stimeout); 637 } 638 else 639 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 640 NULL); 641 } 642 643 if (nfds == -1) 644 { 645 646 cupsdLogMessage(CUPSD_LOG_WARN, "cupsdDoSelect: select() returned %d (2nd failure)... pause and setting socket to non-blocking mode", 625 647 nfds); 626 if (timeout >= 0 && timeout < 86400) 627 { 628 stimeout.tv_sec = timeout; 629 stimeout.tv_usec = 0; 630 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 648 /* fcntl O_NONBLOCK doesn't always succeed on OS/2 - force the socket to be non-blocking */ 649 char dontblock =1; 650 os2_ioctl(maxfd, FIONBIO, &dontblock,sizeof(dontblock)); 651 652 usleep(500000); 653 if (timeout >= 0 && timeout < 86400) 654 { 655 stimeout.tv_sec = timeout; 656 stimeout.tv_usec = 0; 657 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 631 658 &stimeout); 632 }633 else634 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL,659 } 660 else 661 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 635 662 NULL); 636 } 637 638 if (nfds == -1) { 639 640 641 /* fcntl O_NONBLOCK doesn't always succeed on OS/2 - force the socket to be non-blocking */ 642 char dontblock =1; 643 cupsdLogMessage(CUPSD_LOG_INFO, "cupsdDoSelect: select() returned %d (2nd failure)... setting socket to non-blocking mode", 663 } 664 665 if (nfds == -1) 666 { 667 cupsdLogMessage(CUPSD_LOG_WARN, "cupsdDoSelect: select() returned %d (3rd failure)... pause and retry select()", 644 668 nfds); 645 os2_ioctl(maxfd, FIONBIO, &dontblock,sizeof(dontblock)); 646 647 usleep(500000); 648 cupsdLogMessage(CUPSD_LOG_INFO, "cupsdDoSelect: select() returned %d (2nd failure)... pause and retry select()", 649 nfds); 650 if (timeout >= 0 && timeout < 86400) 651 { 652 stimeout.tv_sec = timeout; 653 stimeout.tv_usec = 0; 654 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 669 usleep(500000); 670 if (timeout >= 0 && timeout < 86400) 671 { 672 stimeout.tv_sec = timeout; 673 stimeout.tv_usec = 0; 674 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 655 675 &stimeout); 656 }657 else658 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL,676 } 677 else 678 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 659 679 NULL); 660 } 661 662 if (nfds == -1) { 663 usleep(500000); 664 cupsdLogMessage(CUPSD_LOG_INFO, "cupsdDoSelect: select() returned %d (3rd failure)... pause and retry select()", 665 nfds); 666 if (timeout >= 0 && timeout < 86400) 667 { 668 stimeout.tv_sec = timeout; 669 stimeout.tv_usec = 0; 670 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 671 &stimeout); 672 } 673 else 674 nfds = select(maxfd, &cupsd_current_input, &cupsd_current_output, NULL, 675 NULL); 676 } 677 680 } 678 681 #endif 679 682
Note:
See TracChangeset
for help on using the changeset viewer.