Skip to content

Commit 98a21a8

Browse files
jukkarcarlescufi
authored andcommitted
drivers: eth: native_sim: Fix error output when creating interface
The return value already contains the errno so use it when printing the error message. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 0aaf0aa commit 98a21a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/ethernet/eth_native_posix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ static void eth_iface_init(struct net_if *iface)
358358

359359
ctx->dev_fd = eth_iface_create(CONFIG_ETH_NATIVE_POSIX_DEV_NAME, ctx->if_name, false);
360360
if (ctx->dev_fd < 0) {
361-
LOG_ERR("Cannot create %s (%d)", ctx->if_name, -errno);
361+
LOG_ERR("Cannot create %s (%d/%s)", ctx->if_name, ctx->dev_fd,
362+
strerror(-ctx->dev_fd));
362363
} else {
363364
/* Create a thread that will handle incoming data from host */
364365
create_rx_handler(ctx);

0 commit comments

Comments
 (0)