| | 879 | | | | char * |
| | 880 | | | | pvmgetroot() |
| | 881 | | | | { |
| | 882 | | | | static char *rd = 0; |
| | 883 | | | | |
| $input_12 >= UNKNOWN | 884 | | | | if (!rd) { |
| | 885 | | | | |
| | 886 | | | | #ifdef IMA_CSPP |
| | 887 | | | | |
| | 888 | | | | struct stat buf; |
| | 889 | | | | |
| | 890 | | | | rd = STRALLOC("/usr/convex/pvm"); |
| | 891 | | | | if (stat(rd, &buf) == -1) { |
| | 892 | | | | pvmlogperror( |
| | 893 | | | | "Unable to default PVM_ROOT to /usr/convex/pvm"); |
| | 894 | | | | pvmbailout(0); |
| | 895 | | | | exit(1); |
| | 896 | | | | } |
| | 897 | | | | pvmputenv("PVM_ROOT=/usr/convex/pvm"); |
| | 898 | | | | pvmlogerror("Defaulting PVM_ROOT to /usr/convex/pvm"); |
| | 899 | | | | |
| | 900 | | | | #else |
| | 901 | | | | |
| | 902 | | | | #ifdef CYGWIN |
| | 903 | | | | rd = getenv("PVM_ROOT_U"); |
| | 904 | | | | #else |
| | 905 | | | | rd = getenv("PVM_ROOT"); |
| | 906 | | | | #endif |
| | 907 | | | | |
| | 908 | | | | #ifdef WIN32 |
| | 909 | | | | if (!rd) |
| | 910 | | | | rd = read_pvmregistry("PVM_ROOT"); |
| | 911 | | | | #endif |
| | 912 | | | | |
| | 913 | | | | #endif |
| | 914 | | | | |
| | 915 | | | | if (!rd) { |
| | 916 | | | | pvmlogerror("PVM_ROOT environment variable not set.\n"); |
| | 917 | | | | pvmbailout(0); |
| | 918 | | | | exit(1); |
| | 919 | | | | } |
| | 920 | | | | } |
| | 921 | | | | |
| | 922 | | | | return rd; |
| | 923 | | | | } |