[ext][LXC contribution] request of modify error return value

0 views
Skip to first unread message

박세준

unread,
Mar 15, 2022, 10:06:45 PM3/15/22
to lxc-...@lists.linuxcontainers.org, 김건수, 박승호

Dear members of lxc develop 


My name is Sejoon park who is working LGE company. 


when i tested container booting fail by using lxc-start tool, the trace log message noticed wrong  me. Actually, if iw tool was not found on PATH, error return value should be ENOENT  instead of -1.

return error code -1 will only show no permission log. 


If i wanted to contrubute on this lxc project. should i insert the modification like below?

I would like to request modification about return error value like below. 


in detail

---------------------------------------------------------------------------------------------



From 8ceeca9c032fa6db3ee975ba4a03012617204e85 Mon Sep 17 00:00:00 2001

From: "sejoon.park" <sejoo...@lge.com>

Date: Thu, 10 Feb 2022 16:37:54 +0900

Subject: [PATCH] Inappropriate error no return


In this moment, "iw" tool can't be found so return value should be ENOENT(2)


Signed-off-by: sejoon.park <sejoo...@lge.com>

---

 src/lxc/network.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/src/lxc/network.c b/src/lxc/network.c

index 81efc8a7a..b34780158 100644

--- a/src/lxc/network.c

+++ b/src/lxc/network.c

@@ -1647,7 +1647,7 @@ int lxc_netdev_move_wlan(char *physname, const char *ifname, pid_t pid,

  cmd = on_path("iw", NULL);

  if (!cmd) {

  ERROR("Couldn't find the application iw in PATH");

- return -1;

+ return ret_errno(ENOENT);

  }

 

  fpid = fork();

-- 

2.31.0



thanks

reagard


Sejoon Park



Reply all
Reply to author
Forward
0 new messages