[LIBC] code cleanup
This commit is contained in:
parent
01c3460cdb
commit
87171f003c
|
@ -91,7 +91,7 @@ FILEHANDLE _sys_open(const char *name, int openmode)
|
|||
}
|
||||
|
||||
fd = open(name, mode, 0);
|
||||
if(fd < 0)
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
else
|
||||
return fd + STDERR + 1;
|
||||
|
@ -138,7 +138,7 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
|
|||
return 0;
|
||||
#else
|
||||
size = read(fh - STDERR - 1, buf, len);
|
||||
if(size >= 0)
|
||||
if (size >= 0)
|
||||
return len - size;
|
||||
else
|
||||
return -1;
|
||||
|
@ -174,14 +174,14 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
|
|||
#endif
|
||||
}
|
||||
|
||||
if(fh == STDIN)
|
||||
if (fh == STDIN)
|
||||
return -1;
|
||||
|
||||
#ifndef RT_USING_DFS
|
||||
return 0;
|
||||
#else
|
||||
size = write(fh - STDERR - 1, buf, len);
|
||||
if(size >= 0)
|
||||
if (size >= 0)
|
||||
return len - size;
|
||||
else
|
||||
return -1;
|
||||
|
@ -270,6 +270,6 @@ int remove(const char *filename)
|
|||
int system(const char *string)
|
||||
{
|
||||
RT_ASSERT(0);
|
||||
for(;;);
|
||||
for (;;);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue