libposix: cleanups

This commit is contained in:
Giacomo Tesio 2017-05-29 23:27:30 +02:00
parent d1e285f721
commit e525113266
3 changed files with 12 additions and 12 deletions

View File

@ -143,11 +143,11 @@ POSIX_read(int *errnop, int fd, char *buf, size_t len)
*errnop = __libposix_get_errno(PosixEBADF);
return -1;
}
SignalReenter:
OnIgnoredSignalInterrupt:
r = sys_pread(fd, buf, len, -1);
if(r < 0){
if(__libposix_restart_syscall())
goto SignalReenter;
goto OnIgnoredSignalInterrupt;
*errnop = __libposix_translate_errstr((uintptr_t)POSIX_read);
return -1;
}
@ -163,11 +163,11 @@ POSIX_write(int *errnop, int fd, const void *buf, size_t len)
*errnop = __libposix_get_errno(PosixEBADF);
return -1;
}
SignalReenter:
OnIgnoredSignalInterrupt:
w = sys_pwrite(fd, buf, len, -1);
if(w < 0){
if(__libposix_restart_syscall())
goto SignalReenter;
goto OnIgnoredSignalInterrupt;
*errnop = __libposix_translate_errstr((uintptr_t)POSIX_write);
return -1;
}
@ -275,12 +275,12 @@ POSIX_fstat(int *errnop, int file, void *pstat)
*errnop = __libposix_get_errno(PosixEBADF);
return -1;
}
SignalReenter:
OnIgnoredSignalInterrupt:
d = dirfstat(file);
if(d == nil)
{
if(__libposix_restart_syscall())
goto SignalReenter;
goto OnIgnoredSignalInterrupt;
*errnop = __libposix_translate_errstr((uintptr_t)POSIX_fstat);
return -1;
}

View File

@ -204,11 +204,11 @@ POSIX_wait(int *errnop, int *status)
return pid;
}
SignalReenter:
OnIgnoredSignalInterrupt:
w = wait();
if(w == nil){
if(__libposix_restart_syscall())
goto SignalReenter;
goto OnIgnoredSignalInterrupt;
*errnop = __libposix_get_errno(PosixECHILD);
return -1;
}
@ -293,11 +293,11 @@ POSIX_waitpid(int *errnop, int reqpid, int *status, int options)
}
WaitAgain:
SignalReenter:
OnIgnoredSignalInterrupt:
w = wait();
if(w == nil){
if(__libposix_restart_syscall())
goto SignalReenter;
goto OnIgnoredSignalInterrupt;
*errnop = __libposix_get_errno(PosixECHILD);
return -1;
}

View File

@ -271,10 +271,10 @@ __libposix_receive_signal(int sig)
switch(action){
case SignalCatched:
return 0;
break;
case SignalIgnored:
*__restart_syscall = 1;
return 0;
break;
case SignalDefault:
disposition = default_signal_disposition(sig);
if(!execute_disposition(sig, disposition))