| 2888 | | tm_shmconn(tp, mp) |
| 2889 | | struct task *tp; |
| 2890 | | struct pmsg *mp; |
| 2891 | | { |
| 2892 | | int tid; |
| 2893 | | int pid; |
| 2894 | | int ppid; |
| 2895 | | struct task *tp2; |
| 2896 | | struct pmsg *mp2; |
| 2897 | | int cc; |
| 2898 | | char c; |
| 2899 | | int dummy_true = 1; |
| 2900 | | |
| 2901 | | if ( upkint( mp, &ppid ) ) { |
| 2902 | | pvmlogerror( |
| 2903 | | "tm_shmconn() bad msg format. Missing Unix pid??\n" ); |
| 2904 | | goto bail; |
| 2905 | | } |
| 2906 | | |
| 2907 | | #ifndef SHMEM |
| 2908 | | if ( dummy_true ) { |
| 2909 | | pvmlogerror( "tm_shmconn() shmem conn on non shmem sys? " ); |
| 2910 | | pvmlogerror( "Bit bucket...\n" ); |
| 2911 | | goto bail; |
| 2912 | | } |
| 2913 | | #endif |
| 2914 | | |
| 2915 | | |
| 2916 | | |
| 2917 | | |
| 2918 | | |
| 2919 | | |
| 2920 | | |
| 2921 | | if ( tp2 = task_findpid( ppid ) ) |
| 2922 | | { |
| 2923 | | if ( pvmdebmask & PDMTASK ) {
|
| 2924 | | pvmlogprintf( |
| 2925 | | "tm_shmconn() reconnect task t%x via sockets\n", |
| 2926 | | tp2->t_tid); |
| 2927 | | } |
| 2928 | | |
| 2929 | | } |
| 2930 | | else |
| 2931 | | { |
| 2932 | | pvmlogerror( "tm_shmconn() conn from non shmem connd task?\n"); |
| 2933 | | goto bail; |
| 2934 | | } |
| 2935 | | |
| 2936 | | |
| 2937 | | |
| 2938 | | |
| 2939 | | |
| 2940 | | |
| 2941 | | |
| 2942 | | |
| 2943 | | tp2->t_sock = tp->t_sock; |
| 2944 | | |
| 2945 | | tp->t_sock = -1; |
| 2946 | | tp->t_rxp = 0; |
| 2947 | | tp->t_flag |= TF_CLOSE;
|
| 2948 | | |
| 2949 | | |
| 2950 | | |
| 2951 | | |
| 2952 | | |
| 2953 | | |
| 2954 | | |
| 2955 | | |
| 2956 | | |
| 2957 | | |
| 2958 | | |
| 2959 | | |
| 2960 | | tp2->t_flag |= TF_PRESHMCONN;
|
| 2961 | | |
| 2962 | | return 0; |
| 2963 | | |
| 2964 | | bail: |
| 2965 | | |
| 2966 | | tp->t_sock = -1; |
| 2967 | | tp->t_rxp = 0; |
| 2968 | | tp->t_flag |= TF_CLOSE;
|
| 2969 | | return 0; |
| 2970 | | } |