if (!fp)
{
- WLog_ERR(TAG, "fdopen(%d) failed with %s [%08X]", pFile->fd,
+ WLog_ERR(TAG, "fdopen(%s) failed with %s [%08X]", pFile->lpFileName,
strerror(errno), errno);
return INVALID_SET_FILE_POINTER;
}
if (fseek(fp, offset, whence))
{
- WLog_ERR(TAG, "fseek(%d) failed with %s [%08X]", pFile->fd,
+ WLog_ERR(TAG, "fseek(%s) failed with %s [%08X]", pFile->lpFileName,
strerror(errno), errno);
return INVALID_SET_FILE_POINTER;
}
if (!fp)
{
- WLog_ERR(TAG, "fdopen(%d) failed with %s [%08X]", file->fd,
+ WLog_ERR(TAG, "fopen(%s) failed with %s [%08X]", file->lpFileName,
strerror(errno), errno);
return INVALID_FILE_SIZE;
}
if (cur < 0)
{
- WLog_ERR(TAG, "ftell(%d) failed with %s [%08X]", file->fd,
+ WLog_ERR(TAG, "ftell(%s) failed with %s [%08X]", file->lpFileName,
strerror(errno), errno);
return INVALID_FILE_SIZE;
}
if (fseek(fp, 0, SEEK_END) != 0)
{
- WLog_ERR(TAG, "fseek(%d) failed with %s [%08X]", file->fd,
+ WLog_ERR(TAG, "fseek(%s) failed with %s [%08X]", file->lpFileName,
strerror(errno), errno);
return INVALID_FILE_SIZE;
}
if (size < 0)
{
- WLog_ERR(TAG, "ftell(%d) failed with %s [%08X]", file->fd,
+ WLog_ERR(TAG, "ftell(%s) failed with %s [%08X]", file->lpFileName,
strerror(errno), errno);
return INVALID_FILE_SIZE;
}
if (fseek(fp, cur, SEEK_SET) != 0)
{
- WLog_ERR(TAG, "ftell(%d) failed with %s [%08X]", file->fd,
+ WLog_ERR(TAG, "ftell(%s) failed with %s [%08X]", file->lpFileName,
strerror(errno), errno);
return INVALID_FILE_SIZE;
}
if (pFile->bLocked)
{
- WLog_ERR(TAG, "File %d already locked!", pFile->fd);
+ WLog_ERR(TAG, "File %s already locked!", pFile->lpFileName);
return FALSE;
}
if (!pFile->bLocked)
{
- WLog_ERR(TAG, "File %d is not locked!", pFile->fd);
+ WLog_ERR(TAG, "File %s is not locked!", pFile->lpFileName);
return FALSE;
}
if (flock(pFile->fd, LOCK_UN) < 0)
{
- WLog_ERR(TAG, "flock(LOCK_UN) %d failed with %s [%08X]",
- pFile->fd, strerror(errno), errno);
+ WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [%08X]",
+ pFile->lpFileName, strerror(errno), errno);
return FALSE;
}
if (!pFile->bLocked)
{
- WLog_ERR(TAG, "File %d is not locked!", pFile->fd);
+ WLog_ERR(TAG, "File %s is not locked!", pFile->lpFileName);
return FALSE;
}
if (flock(pFile->fd, LOCK_UN) < 0)
{
- WLog_ERR(TAG, "flock(LOCK_UN) %d failed with %s [%08X]",
- pFile->fd, strerror(errno), errno);
+ WLog_ERR(TAG, "flock(LOCK_UN) %s failed with %s [%08X]",
+ pFile->lpFileName, strerror(errno), errno);
return FALSE;
}
FileUnlockFileEx
};
-static HANDLE_OPS pipeOps = {
+static HANDLE_OPS shmOps = {
FileIsHandled,
FileCloseHandle,
FileGetFd,
HANDLE hFile;
char name[MAX_PATH];
- _snprintf(name, sizeof(name), "pipe_device_%d", fd);
+ _snprintf(name, sizeof(name), "device_%d", fd);
pFile = (WINPR_FILE*) calloc(1, sizeof(WINPR_FILE));
if (!pFile)
{
return NULL;
}
pFile->fd = fd;
- pFile->ops = &pipeOps;
+ pFile->ops = &shmOps;
pFile->lpFileName = _strdup(name);
hFile = (HANDLE) pFile;