Merge branch 'master' into devop_socket

Conflicts:
	libctru/source/services/soc/soc_ioctl.c
This commit is contained in:
Dave Murphy 2015-02-12 15:52:15 +00:00
commit 71a59a1da3
7 changed files with 33 additions and 32 deletions

View File

@ -39,7 +39,7 @@ typedef volatile s64 vs64;
typedef u32 Handle; typedef u32 Handle;
typedef s32 Result; typedef s32 Result;
typedef void (*ThreadFunc)(u32); typedef void (*ThreadFunc)(void *);
#define BIT(n) (1U<<(n)) #define BIT(n) (1U<<(n))

View File

@ -565,6 +565,7 @@ sdmc_stat(struct _reent *r,
st->st_uid = 1; st->st_uid = 1;
st->st_gid = 2; st->st_gid = 2;
st->st_mode = S_IFDIR | S_IWUSR | S_IWGRP | S_IWOTH | S_IRUSR | S_IRGRP | S_IROTH; st->st_mode = S_IFDIR | S_IWUSR | S_IWGRP | S_IWOTH | S_IRUSR | S_IRGRP | S_IROTH;
FSFILE_Close(fd);
return 0; return 0;
} }

View File

@ -380,7 +380,7 @@ static bool __handle_incoming_parameter() {
return true; return true;
} }
void aptEventHandler(u32 arg) void aptEventHandler(void *arg)
{ {
bool runThread = true; bool runThread = true;

View File

@ -410,7 +410,7 @@ Result csndPlaySound(int chn, u32 flags, u32 sampleRate, void* data0, void* data
if (data0) paddr0 = osConvertVirtToPhys((u32)data0); if (data0) paddr0 = osConvertVirtToPhys((u32)data0);
if (data1) paddr1 = osConvertVirtToPhys((u32)data1); if (data1) paddr1 = osConvertVirtToPhys((u32)data1);
if (encoding == CSND_ENCODING_ADPCM) if (data0 && encoding == CSND_ENCODING_ADPCM)
{ {
int adpcmSample = ((s16*)data0)[-2]; int adpcmSample = ((s16*)data0)[-2];
int adpcmIndex = ((u8*)data0)[-2]; int adpcmIndex = ((u8*)data0)[-2];

View File

@ -21,7 +21,7 @@ Handle gspEventThread;
static Handle gspEvent; static Handle gspEvent;
static vu8* gspEventData; static vu8* gspEventData;
static void gspEventThreadMain(u32 arg); static void gspEventThreadMain(void *arg);
Result gspInit() Result gspInit()
@ -82,7 +82,7 @@ void gspWaitForEvent(GSP_Event id, bool nextEvent)
svcClearEvent(gspEvents[id]); svcClearEvent(gspEvents[id]);
} }
void gspEventThreadMain(u32 arg) void gspEventThreadMain(void *arg)
{ {
while (gspRunEvents) while (gspRunEvents)
{ {

View File

@ -43,8 +43,8 @@ Result httpcOpenContext(httpcContext *context, char* url, u32 use_defaultproxy)
ret = HTTPC_InitializeConnectionSession(context->servhandle, context->httphandle); ret = HTTPC_InitializeConnectionSession(context->servhandle, context->httphandle);
if(ret!=0) { if(ret!=0) {
HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
svcCloseHandle(context->servhandle); svcCloseHandle(context->servhandle);
HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
return ret; return ret;
} }
@ -52,8 +52,8 @@ Result httpcOpenContext(httpcContext *context, char* url, u32 use_defaultproxy)
ret = HTTPC_SetProxyDefault(context->servhandle, context->httphandle); ret = HTTPC_SetProxyDefault(context->servhandle, context->httphandle);
if(ret!=0) { if(ret!=0) {
HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
svcCloseHandle(context->servhandle); svcCloseHandle(context->servhandle);
HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
return ret; return ret;
} }
@ -64,8 +64,8 @@ Result httpcCloseContext(httpcContext *context)
{ {
Result ret=0; Result ret=0;
ret = HTTPC_CloseContext(context->servhandle, context->httphandle);
svcCloseHandle(context->servhandle); svcCloseHandle(context->servhandle);
ret = HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
return ret; return ret;
} }
@ -216,16 +216,16 @@ Result HTTPC_AddRequestHeaderField(Handle handle, Handle contextHandle, char* na
{ {
u32* cmdbuf=getThreadCommandBuffer(); u32* cmdbuf=getThreadCommandBuffer();
int l1=strlen(name)+1; int name_len=strlen(name)+1;
int l2=strlen(value)+1; int value_len=strlen(value)+1;
cmdbuf[0]=0x1100c4; //request header code cmdbuf[0]=0x1100c4; //request header code
cmdbuf[1]=contextHandle; cmdbuf[1]=contextHandle;
cmdbuf[2]=l1; cmdbuf[2]=name_len;
cmdbuf[3]=l2; cmdbuf[3]=value_len;
cmdbuf[4]=(l1<<14)|0xC02; cmdbuf[4]=(name_len<<14)|0xC02;
cmdbuf[5]=(u32)name; cmdbuf[5]=(u32)name;
cmdbuf[6]=(l1<<4)|0xA; cmdbuf[6]=(value_len<<4)|0xA;
cmdbuf[7]=(u32)value; cmdbuf[7]=(u32)value;
Result ret=0; Result ret=0;

View File

@ -25,7 +25,7 @@ int ioctl(int sockfd, int request, ...)
if(value == NULL) { if(value == NULL) {
errno = EFAULT; errno = EFAULT;
ret = -1; return -1;
} }
flags = fcntl(sockfd, F_GETFL, 0); flags = fcntl(sockfd, F_GETFL, 0);