summaryrefslogtreecommitdiff
path: root/Kernel/Net/NetworkingManagement.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2023-02-04 14:15:37 +0200
committerLinus Groh <mail@linusgroh.de>2023-02-10 09:14:20 +0000
commit2d1719da73d9c97eb186949ad7a465ac2cb38617 (patch)
tree98ac3cd964aeb17f0f8273fb32915a496d6e1c64 /Kernel/Net/NetworkingManagement.cpp
parent2715f91c925f9ac41f06486303b9cf60b41615e4 (diff)
downloadserenity-2d1719da73d9c97eb186949ad7a465ac2cb38617.zip
Kernel/Net: Propagate proper errno codes from determine_network_device
Returning literal strings is not the proper action here, because we should always assume that error could be propagated back to userland, so we need to keep a valid errno when returning an Error.
Diffstat (limited to 'Kernel/Net/NetworkingManagement.cpp')
-rw-r--r--Kernel/Net/NetworkingManagement.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Net/NetworkingManagement.cpp b/Kernel/Net/NetworkingManagement.cpp
index c8b1ae7bb0..d0d95a123e 100644
--- a/Kernel/Net/NetworkingManagement.cpp
+++ b/Kernel/Net/NetworkingManagement.cpp
@@ -117,7 +117,8 @@ UNMAP_AFTER_INIT ErrorOr<NonnullLockRefPtr<NetworkAdapter>> NetworkingManagement
return adapter;
}
}
- return Error::from_string_literal("Unsupported network adapter");
+ dmesgln("Networking: Failed to initialize device {}, unsupported network adapter", device_identifier.address());
+ return Error::from_errno(ENODEV);
}
bool NetworkingManagement::initialize()