diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-29 21:59:50 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-30 02:02:30 +0200 |
commit | a90609857978efdacc0dbe64aa649dbc54ed3827 (patch) | |
tree | c9997b22f6e8d5b363aa70ece925ff4fb7d665ac /Kernel/Net | |
parent | 3ffb2ad4e0eaec6485e36561b22c742ff0de25d4 (diff) | |
download | serenity-a90609857978efdacc0dbe64aa649dbc54ed3827.zip |
Kernel: Fix a bad printf, and stub out SO_ERROR a bit more fully
links requests SO_ERROR, so in not supporting it, things were unhappy.
Supporting this properly looks a little messy. I guess Socket will need
an m_error member it sets everywhere it returns an error. Or Syscall
could set it, perhaps, but I don't know if that's the right thing to
do, so let's just stub this for now and file a bug.
Diffstat (limited to 'Kernel/Net')
-rw-r--r-- | Kernel/Net/Socket.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 944145b9b1..f7892ce759 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -97,8 +97,15 @@ KResult Socket::getsockopt(int level, int option, void* value, socklen_t* value_ *(timeval*)value = m_receive_timeout; *value_size = sizeof(timeval); return KSuccess; + case SO_ERROR: + if (*value_size < sizeof(int)) + return KResult(-EINVAL); + kprintf("%s(%u): getsockopt() SO_ERROR: WARNING! I have no idea what the real error is, so I'll just stick my fingers in my ears and pretend there is none! %d\n", current->process().name().characters(), option); + *(int*)value = 0; + *value_size = sizeof(int); + return KSuccess; default: - kprintf("%s(%u): getsockopt() at SOL_SOCKET with unimplemented option %d\n", option); + kprintf("%s(%u): getsockopt() at SOL_SOCKET with unimplemented option %d\n", current->process().name().characters(), option); return KResult(-ENOPROTOOPT); } } |