fnctl: Do not switch on cmd

This commit is contained in:
apio 2022-10-16 17:27:15 +02:00
parent e1e86ab889
commit f35bbe52b7

View File

@ -1,5 +1,6 @@
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
#include <sys/syscall.h>
#include <unistd.h>
@ -14,12 +15,7 @@ extern "C"
{
va_list ap;
va_start(ap, cmd);
long result;
switch (cmd)
{
case F_DUPFD: result = syscall(SYS_fcntl, fd, cmd, va_arg(ap, int)); break;
default: result = syscall(SYS_fcntl, fd, cmd, 0); break;
}
long result = syscall(SYS_fcntl, fd, cmd, va_arg(ap, uintptr_t));
va_end(ap);
return (int)result;
}