Changeset 6603 for pymolproxy


Ignore:
Timestamp:
Nov 10, 2016 7:16:03 PM (7 years ago)
Author:
ldelgass
Message:

fix error status

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pymolproxy/trunk/pymolproxy.c

    r6602 r6603  
    200200    int rockOffset;
    201201    int cacheId;
    202     int error;
    203202    int status;
    204203    int width, height;                  /* Size of viewport. */
     
    299298    size_t length;
    300299
    301     if (proxyPtr->error) {
    302         return TCL_ERROR;
    303     }
    304 
    305300    va_start(ap, format);
    306     result = vsnprintf(buffer, BUFSIZ-1, format, ap);
     301    result = vsnprintf(buffer, BUFSIZ, format, ap);
    307302    va_end(ap);
     303    if (result >= BUFSIZ) {
     304        ERROR("Buffer too small for command (len=%d)", result);
     305        proxyPtr->status = TCL_ERROR;
     306        return proxyPtr->status;
     307    }
    308308
    309309#ifdef EXEC_DEBUG
    310     DEBUG("to-pymol>(%s) code=%d", buffer, result);
     310    DEBUG("to-pymol>(%s) len=%d", buffer, result);
    311311#endif
    312312    if (recording) {
     
    320320        ERROR("short write to pymol (wrote=%d, should have been %d): %s",
    321321              numWritten, length, strerror(errno));
    322     }
    323     proxyPtr->status = result;
    324     return  proxyPtr->status;
     322        proxyPtr->status = TCL_ERROR;
     323    }
     324    return proxyPtr->status;
    325325}
    326326
     
    552552clear_error(PymolProxy *proxyPtr)
    553553{
    554     proxyPtr->error = 0;
    555554    proxyPtr->status = TCL_OK;
    556555}
     
    21562155            close(f);
    21572156        }
    2158         INFO("attempting to start \"%s\"", argv[0]);
     2157        INFO("Executing \"%s\"", argv[0]);
    21592158        execvp(argv[0], argv);
    21602159        ERROR("can't exec `%s': %s", argv[0], strerror(errno));
Note: See TracChangeset for help on using the changeset viewer.