fix race bug

This commit is contained in:
uvos 2021-10-02 14:22:00 +02:00
parent 15216f7f3a
commit 84dd4bc30a
4 changed files with 71 additions and 26 deletions

View file

@ -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)