Fix system calls returning errno values instead of setting errno.
This commit is contained in:
parent
eeea3bdcc6
commit
cb88c18bf0
|
@ -608,7 +608,7 @@ int Descriptor::utimens(ioctx_t* ctx, const struct timespec* user_times)
|
||||||
return -1;
|
return -1;
|
||||||
if ( !valid_utimens_timespec(times[0]) ||
|
if ( !valid_utimens_timespec(times[0]) ||
|
||||||
!valid_utimens_timespec(times[1]) )
|
!valid_utimens_timespec(times[1]) )
|
||||||
return errno = EINVAL;
|
return errno = EINVAL, -1;
|
||||||
// TODO: Regardless of dflags, check if the user/group can utimens.
|
// TODO: Regardless of dflags, check if the user/group can utimens.
|
||||||
return vnode->utimens(ctx, times);
|
return vnode->utimens(ctx, times);
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,7 +282,7 @@ int sys_ftruncate(int fd, off_t length)
|
||||||
int sys_fstatat(int dirfd, const char* path, struct stat* st, int flags)
|
int sys_fstatat(int dirfd, const char* path, struct stat* st, int flags)
|
||||||
{
|
{
|
||||||
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
|
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
|
||||||
return errno = EINVAL;
|
return errno = EINVAL, -1;
|
||||||
char* pathcopy = GetStringFromUser(path);
|
char* pathcopy = GetStringFromUser(path);
|
||||||
if ( !pathcopy )
|
if ( !pathcopy )
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -319,7 +319,7 @@ int sys_fstatvfs(int fd, struct statvfs* stvfs)
|
||||||
int sys_fstatvfsat(int dirfd, const char* path, struct statvfs* stvfs, int flags)
|
int sys_fstatvfsat(int dirfd, const char* path, struct statvfs* stvfs, int flags)
|
||||||
{
|
{
|
||||||
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
|
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
|
||||||
return errno = EINVAL;
|
return errno = EINVAL, -1;
|
||||||
char* pathcopy = GetStringFromUser(path);
|
char* pathcopy = GetStringFromUser(path);
|
||||||
if ( !pathcopy )
|
if ( !pathcopy )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -2016,7 +2016,7 @@ ssize_t TCPSocket::send_unlocked(ioctx_t* ctx,
|
||||||
if ( sockerr )
|
if ( sockerr )
|
||||||
return errno = sockerr, -1;
|
return errno = sockerr, -1;
|
||||||
if ( ctx->dflags & O_NONBLOCK )
|
if ( ctx->dflags & O_NONBLOCK )
|
||||||
return errno = EWOULDBLOCK;
|
return errno = EWOULDBLOCK, -1;
|
||||||
if ( !kthread_cond_wait_signal(&transmit_cond, &tcp_lock) )
|
if ( !kthread_cond_wait_signal(&transmit_cond, &tcp_lock) )
|
||||||
return errno = EINTR, -1;
|
return errno = EINTR, -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ int sys_sigaction(int signum,
|
||||||
struct sigaction* user_oldact)
|
struct sigaction* user_oldact)
|
||||||
{
|
{
|
||||||
if ( signum < 0 || signum == 0 /* null signal */ || SIG_MAX_NUM <= signum )
|
if ( signum < 0 || signum == 0 /* null signal */ || SIG_MAX_NUM <= signum )
|
||||||
return errno = EINVAL;
|
return errno = EINVAL, -1;
|
||||||
|
|
||||||
Process* process = CurrentProcess();
|
Process* process = CurrentProcess();
|
||||||
ScopedLock lock(&process->signal_lock);
|
ScopedLock lock(&process->signal_lock);
|
||||||
|
|
|
@ -760,7 +760,7 @@ int TTY::tcflow(ioctx_t* /*ctx*/, int action)
|
||||||
case TCOON: break; // TODO: Resume suspended output.
|
case TCOON: break; // TODO: Resume suspended output.
|
||||||
case TCIOFF: break; // TODO: Transmit STOP character.
|
case TCIOFF: break; // TODO: Transmit STOP character.
|
||||||
case TCION: break; // TODO: Transmit START character.
|
case TCION: break; // TODO: Transmit START character.
|
||||||
default: return errno = EINVAL -1;
|
default: return errno = EINVAL, -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue