-r is working

This commit is contained in:
elvis
2022-04-27 21:18:25 +02:00
parent 5151418090
commit 8841ca95a0
8 changed files with 65 additions and 43 deletions

View File

@ -26,9 +26,9 @@
static inline int readn(long fd, void *buf, size_t size) {
size_t left = size;
int r;
char *bufptr = (char*)buf;
char *bufptr = (char*) buf;
while(left>0) {
if ((r=read(fd ,bufptr,left)) == -1) {
if ((r=read(fd, bufptr, left)) == -1) {
if (errno == EINTR) continue;
return -1;
}
@ -48,7 +48,7 @@ static inline int readn(long fd, void *buf, size_t size) {
static inline int writen(long fd, void *buf, size_t size) {
size_t left = size;
int r;
char *bufptr = (char*)buf;
char *bufptr = (char*) buf;
while(left>0) {
if ((r=write(fd, bufptr, left)) == -1) {
if (errno == EINTR) continue;