fnctl: Do not switch on cmd
This commit is contained in:
parent
e1e86ab889
commit
f35bbe52b7
@ -1,5 +1,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@ -14,12 +15,7 @@ extern "C"
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, cmd);
|
va_start(ap, cmd);
|
||||||
long result;
|
long result = syscall(SYS_fcntl, fd, cmd, va_arg(ap, uintptr_t));
|
||||||
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;
|
|
||||||
}
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return (int)result;
|
return (int)result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user