fix race bug
This commit is contained in:
parent
15216f7f3a
commit
84dd4bc30a
4 changed files with 71 additions and 26 deletions
|
|
@ -1,13 +1,15 @@
|
|||
#include "serial_io.h"
|
||||
|
||||
void sWrite(int port, char string[], size_t length)
|
||||
ssize_t sWrite(int port, char string[], size_t length)
|
||||
{
|
||||
if(port != -1) write(port, string, length);
|
||||
if(port != -1) return write(port, string, length);
|
||||
else return 0;
|
||||
}
|
||||
|
||||
void sWrite(int port, const char string[], size_t length)
|
||||
ssize_t sWrite(int port, const char string[], size_t length)
|
||||
{
|
||||
if(port != -1) write(port, string, length);
|
||||
if(port != -1) return write(port, string, length);
|
||||
else return 0;
|
||||
}
|
||||
|
||||
ssize_t sRead(int port, void *buf, size_t count)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue