- Timestamp:
- May 4, 2007 12:13:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/vizservers/pymolproxy/pymolproxy.c
r696 r698 968 968 { 969 969 char buffer[800]; 970 int bytes=0; 970 unsigned int bytes=0; 971 float samples = 0.0; 971 972 struct pymol_proxy *pymol = (struct pymol_proxy *) cdata; 972 973 … … 987 988 waitForString(pymol, "image follows: ", buffer, 800); 988 989 989 sscanf(buffer, "image follows: %d\n", &bytes); 990 990 sscanf(buffer, "image follows: %d %f\n", &bytes, &samples); 991 992 write(3,&samples,sizeof(samples)); 993 991 994 dyBufferSetLength(&pymol->image, bytes); 992 995 … … 1010 1013 { 1011 1014 char buffer[800]; 1012 int bytes=0; 1015 unsigned int bytes=0; 1016 float samples = 0.0; 1013 1017 struct pymol_proxy *pymol = (struct pymol_proxy *) cdata; 1014 1018 … … 1029 1033 waitForString(pymol, "image follows: ", buffer, 800); 1030 1034 1031 sscanf(buffer, "image follows: %d\n", &bytes); 1035 sscanf(buffer, "image follows: %d %f\n", &bytes, &samples); 1036 write(3,&samples,sizeof(samples)); 1032 1037 1033 1038 dyBufferSetLength(&pymol->image, bytes); … … 1048 1053 int pyMol_Proxy(int c_in, int c_out, char *command, char *argv[]) 1049 1054 { 1050 int flags; 1051 int status; 1052 int eof; 1055 int flags, status, result = 0; 1053 1056 int pairIn[2]; 1054 1057 int pairOut[2]; … … 1298 1301 } 1299 1302 1300 status = waitpid(pid, NULL, WNOHANG);1303 status = waitpid(pid, &result, WNOHANG); 1301 1304 1302 1305 if (status == -1) … … 1306 1309 kill(-pid, SIGTERM); // kill process group 1307 1310 alarm(5); 1308 status = waitpid(pid, NULL, 0);1311 status = waitpid(pid, &result, 0); 1309 1312 alarm(0); 1310 1313 … … 1314 1317 kill(-pid, SIGKILL); // kill process group 1315 1318 alarm(10); 1316 status = waitpid(pid, NULL, 0);1319 status = waitpid(pid, &result, 0); 1317 1320 alarm(0); 1318 1321 } 1319 1322 } 1320 1323 1321 fprintf(stderr, "pymolproxy: pymol server process ended \n");1324 fprintf(stderr, "pymolproxy: pymol server process ended (%d)\n", result); 1322 1325 1323 1326 dyBufferFree(&pymol.image);
Note: See TracChangeset
for help on using the changeset viewer.