| | 1027 | | | | | | | 1028 | | | | #ifdef SHAREDTMP | | | 1029 | | | | | | | 1030 | | | | if (gethostname(hna, sizeof(hna)-1) == -1) { | | | 1031 | | | | pvmlogerror("pvmdsockfile() can't gethostname()\n"); | | | 1032 | | | | return (char*)0; | | | 1033 | | | | } | | | 1034 | | | | if (p = CINDEX(hna, '.')) | | | 1035 | | | | *p = 0; | | | 1036 | | | | | | | | | | | ... | | | 1045 | | | | #else | | | 1046 | | | | | | | 1047 | | | | #ifdef IMA_CSPP | | | 1048 | | | | if (scid > 1) | | | 1049 | | | | (void)sprintf(buf, TDSOCKNAME_CSPP, pvmtmp, pvm_useruid, scid); | | | 1050 | | | | else | | | 1051 | | | | #endif | | | 1052 | | | | #ifdef WIN32 | | | 1053 | | | | sprintf( buf, "%s\\pvmd.%s", pvmtmp, username ); | | | 1054 | | | | #else | | | 1055 | | | | (void)sprintf(buf, TDSOCKNAME, pvmtmp, pvm_useruid);
| | | 1056 | | | | #endif | | | 1057 | | | | | | | 1058 | | | | #endif | | | 1059 | | | | | | | 1060 | | | | | | | 1061 | | | | if ( p = getenv("PVM_VMID") ) { | | | 1062 | | | | strcat( buf, "." ); | | | 1063 | | | | strcat( buf, p ); | | | 1064 | | | | } | | | 1065 | | | | | | | 1066 | | | | return buf; | | $input_12 > 127 | 1067 | | | | } |
| | 2827 | | pvmlogerror("mksocs() pvmdsockfile() failed\n"); | | | 2828 | | goto bail; | | | 2829 | | } | | | 2830 | | #ifndef WIN32 | | | 2831 | | if ((d = open(p, O_RDONLY, 0)) == -1) {
| | | 2832 | | #else | | | 2833 | | d = win32_open_file(p); | | | 2834 | | if (d == (HANDLE) -2) { | | | 2835 | | system_loser_win=TRUE; | | | 2836 | | d = (HANDLE) _open(p,O_RDONLY,0); | | | 2837 | | } | | | 2838 | | if (d== (HANDLE) -1) { | | | 2839 | | #endif | | | 2840 | | pvmlogperror(p); | | | 2841 | | goto bail; | | | | | ... | | | 2843 | | #ifdef WIN32 | | | 2844 | | if (!system_loser_win) { | | | 2845 | | n = win32_read_file(d,buf,sizeof(buf)); | | | 2846 | | win32_close_file(d); | | | 2847 | | } | | | 2848 | | else { | | | 2849 | | n = (int)_read((int)d, (void *)buf, (unsigned int)sizeof(buf)); | | | 2850 | | (void)_close((int)d); | | | 2851 | | } | | | 2852 | | #else | | $input_12 > 127 | 2853 | | n = read(d, buf, sizeof(buf)); | | | 2854 | | (void)close(d); | | | 2855 | | #endif | | | 2856 | | if (n == -1) { | | | 2857 | | pvmlogperror("mksocs() read addr file"); | | | 2858 | | goto bail; | | | 2859 | | } | | | 2860 | | if (n == 0) { | | | 2861 | | pvmlogerror("mksocs() read addr file: wrong length read\n"); | | | 2862 | | goto bail; | | | 2863 | | } | | n > 127 | 2864 | | buf[n] = 0; |
|