mirror of
https://git.robbyzambito.me/zaprus
synced 2026-02-04 08:24:52 +00:00
Better error handling and debug logging
This commit is contained in:
@@ -15,7 +15,7 @@ const Ifconf = extern struct {
|
||||
};
|
||||
|
||||
pub fn init() !RawSocket {
|
||||
const socket: i32 = @intCast(std.os.linux.socket(std.os.linux.AF.PACKET, std.os.linux.SOCK.RAW, 0));
|
||||
const socket: i32 = std.math.cast(i32, std.os.linux.socket(std.os.linux.AF.PACKET, std.os.linux.SOCK.RAW, 0)) orelse return error.SocketError;
|
||||
if (socket < 0) return error.SocketError;
|
||||
|
||||
var ifreq_storage: [16]std.os.linux.ifreq = undefined;
|
||||
|
||||
Reference in New Issue
Block a user