free() destroys GetLastError, so preserve it before giving back all the
buffers. Then if the create process failed we have something sensible to
log.
Reviewed-on: http://gerrit.openafs.org/3175
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
e1ed8ab1d93906e1b556de332fa32601a9a489fc)
Change-Id: I028a96a669fff3db48c05f2d894e9c6ef31fad12
Reviewed-on: http://gerrit.openafs.org/3240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
DWORD monitorId, createFlags;
BOOL passingBuffer = (sdatap != NULL && sdatalen > 0);
BOOL fsuccess;
+ int lasterror;
/* verify arguments */
if (!spath || !sargv) {
&startInfo, /* startup info block */
&procInfo);
+ lasterror = GetLastError();
free(pathbuf);
free(argbuf);
free(envbuf);
if (!fsuccess) {
/* failed to spawn process */
- errno = nterr_nt2unix(GetLastError(), ENOENT);
+ errno = nterr_nt2unix(lasterror, ENOENT);
(void)pthread_mutex_lock(&procTableLock);
procTable[tidx].p_reserved = FALSE; /* mark entry as not reserved */