Changes to common source files; not applicable to open-vm-tools.
s->id = Atomic_ReadInc32(&nextid);
s->refCount = 1;
s->vt = vtable;
+ s->inited = TRUE;
if (pollParams) {
s->pollParams = *pollParams;
} else {
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * AsyncSocketTeardownSocket --
+ *
+ * Tear down the AsyncSocket base struct. Currently this just
+ * clears the inited flag and releases the initial (user) refcount.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+AsyncSocketTeardownSocket(AsyncSocket *asock) // IN/OUT
+{
+ /*
+ * Release the initial refcount created when we initialize the
+ * socket struct.
+ */
+ ASSERT(AsyncSocketIsLocked(asock));
+ ASSERT(asock->refCount >= 1);
+ ASSERT(asock->inited);
+ asock->inited = FALSE;
+ AsyncSocketRelease(asock);
+}
+
+
/*
*----------------------------------------------------------------------------
*
AsyncSocketPollParams pollParams;
AsyncSocketState state;
+ Bool inited;
Bool errorSeen;
AsyncSocketErrorFn errorFn;
void *errorClientData;
void AsyncSocketInitSocket(AsyncSocket *asock,
AsyncSocketPollParams *params,
const AsyncSocketVTable *vtable);
+void AsyncSocketTeardownSocket(AsyncSocket *s);
void AsyncSocketLock(AsyncSocket *asock);
void AsyncSocketUnlock(AsyncSocket *asock);
if (VALID(asock, close)) {
AsyncSocketLock(asock);
ret = VT(asock)->close(asock);
- AsyncSocketRelease(asock);
+ ASSERT(!asock->inited);
AsyncSocketUnlock(asock);
} else {
ret = ASOCKERR_INVAL;
}
}
+ AsyncSocketTeardownSocket(base);
return ASOCKERR_SUCCESS;
}
while (TRUE) {
Bool failed;
char *temp;
+#if defined(_WIN32)
+ DWORD status;
+ DWORD statusNew;
+#endif
index = FileFirstSlashIndex(pathName, index + 1);
* This is why we reverse the attempt and the check.
*/
+ /*
+ * Bugfix 1592498, set last error "Access denied" instead of
+ * "File not found". File_XXX have different implementations on
+ * Windows and Linux, this problem only happens on Windows.
+ */
failed = !File_CreateDirectoryEx(temp, mask);
+#if defined(_WIN32)
+ status = GetLastError();
+ statusNew = ERROR_SUCCESS;
+#endif
if (failed) {
if (File_IsDirectory(temp)) {
failed = FALSE;
+ } else {
+#if defined(_WIN32)
+ statusNew = GetLastError();
+#endif
}
} else if (topmostCreated != NULL && *topmostCreated == NULL) {
*topmostCreated = temp;
temp = NULL;
}
+#if defined(_WIN32)
+ if (status == ERROR_ACCESS_DENIED && statusNew == ERROR_FILE_NOT_FOUND) {
+ SetLastError(status);
+ }
+#endif
+
free(temp);
if (failed) {
PRODUCT_GANTRY = 1 << 9,
PRODUCT_VMACORETESTS = 1 << 10,
PRODUCT_SRM = 1 << 11,
- PRODUCT_VIEWCRT = 1 << 12,
/* etc */
} Product;
typedef uint64 ProductMask;