瀏覽代碼

DHCP4Client: Cast unused Timer return values to void

Timers attach themselves to the provided parent, so they are safely kept
alive.
Sam Atkins 3 年之前
父節點
當前提交
2aa0885220
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Userland/Services/DHCPClient/DHCPv4Client.cpp

+ 2 - 2
Userland/Services/DHCPClient/DHCPv4Client.cpp

@@ -243,7 +243,7 @@ void DHCPv4Client::handle_ack(const DHCPv4Packet& packet, const ParsedDHCPv4Opti
     interface.current_ip_address = new_ip;
     interface.current_ip_address = new_ip;
     auto lease_time = AK::convert_between_host_and_network_endian(options.get<u32>(DHCPOption::IPAddressLeaseTime).value_or(transaction->offered_lease_time));
     auto lease_time = AK::convert_between_host_and_network_endian(options.get<u32>(DHCPOption::IPAddressLeaseTime).value_or(transaction->offered_lease_time));
     // set a timer for the duration of the lease, we shall renew if needed
     // set a timer for the duration of the lease, we shall renew if needed
-    Core::Timer::create_single_shot(
+    (void)Core::Timer::create_single_shot(
         lease_time * 1000,
         lease_time * 1000,
         [this, transaction, interface = InterfaceDescriptor { interface }] {
         [this, transaction, interface = InterfaceDescriptor { interface }] {
             transaction->accepted_offer = false;
             transaction->accepted_offer = false;
@@ -267,7 +267,7 @@ void DHCPv4Client::handle_nak(const DHCPv4Packet& packet, const ParsedDHCPv4Opti
     transaction->accepted_offer = false;
     transaction->accepted_offer = false;
     transaction->has_ip = false;
     transaction->has_ip = false;
     auto& iface = transaction->interface;
     auto& iface = transaction->interface;
-    Core::Timer::create_single_shot(
+    (void)Core::Timer::create_single_shot(
         10000,
         10000,
         [this, iface = InterfaceDescriptor { iface }] {
         [this, iface = InterfaceDescriptor { iface }] {
             dhcp_discover(iface);
             dhcp_discover(iface);