Skip to contentSkip to conversation

rust: error: fix the description for `ECHILD`

PATCH Applied Wedson Almeida Filho 7 participants 8 messages Sep 30, 2023 – Oct 12, 2023 Rust

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: error: fix the description for `ECHILD`

From: Wedson Almeida Filho <[email protected]>

A mistake was made and the description of ECHILD is wrong (it reuses the description of ENOEXEC). This fixes it to reflect what's in errno-base.h.

---
 rust/kernel/error.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/error.rs +1 -1
index 05fcab6abfe6..bab2c043fc42 100644
@@ -37,7 +37,7 @@ macro_rules! declare_err {
     declare_err!(E2BIG, "Argument list too long.");
     declare_err!(ENOEXEC, "Exec format error.");
     declare_err!(EBADF, "Bad file number.");
-    declare_err!(ECHILD, "Exec format error.");
+    declare_err!(ECHILD, "No child process.");
     declare_err!(EAGAIN, "Try again.");
     declare_err!(ENOMEM, "Out of memory.");
     declare_err!(EACCES, "Permission denied.");

base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d

Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#3 lore raw
In reply to Wedson Almeida Filho
Quoted 11 lines · Wedson Almeida Filho

From: Wedson Almeida Filho <[email protected]>

A mistake was made and the description of ECHILD is wrong (it reuses the description of ENOEXEC). This fixes it to reflect what's in errno-base.h.

---
  rust/kernel/error.rs | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#6 lore raw
In reply to Wedson Almeida Filho
Quoted 16 lines · Wedson Almeida Filho

From: Wedson Almeida Filho <[email protected]>

A mistake was made and the description of ECHILD is wrong (it reuses the description of ENOEXEC). This fixes it to reflect what's in errno-base.h.

---
  rust/kernel/error.rs | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/error.rs +0 -0
index 05fcab6abfe6..bab2c043fc42 100644

rust/kernel/error.rs macro_rules! declare_err { · line 40

Quoted 5 lines
rust/kernel/error.rs +1 -1
@@ -37,7 +37,7 @@ macro_rules! declare_err {
      declare_err!(E2BIG, "Argument list too long.");
      declare_err!(ENOEXEC, "Exec format error.");
      declare_err!(EBADF, "Bad file number.");
-    declare_err!(ECHILD, "Exec format error.");
+    declare_err!(ECHILD, "No child process.");

Strictly speaking, errno-base.h documents this as "No child processes" (note the plural), but I am fine with taking it as-is.

#7 lore raw
Quoted 3 lines · Benno Lossin

Strictly speaking, errno-base.h documents this as "No child processes" (note the plural), but I am fine with taking it as-is.

Good catch.

POSIX seems to use both (General Information vs. <errno.h>), so perhaps that is where Wedson picked it from.

Given the kernel uses the plural, and that the commit message says it mimics errno-base.h, I have amended it.

Cheers,
Miguel

1: 77983c791960 ! 1: 17bfcd6a8153 rust: error: fix the description for ECHILD

    @@ Commit message
         Fixes: 266def2a0f5b ("rust: error: add codes from `errno-base.h`")
         Cc: [email protected]
         Link: https://lore.kernel.org/r/[email protected]
    +    [ Use the plural, as noticed by Benno. ]
         Signed-off-by: Miguel Ojeda <[email protected]>

      ## rust/kernel/error.rs ##
    @@ rust/kernel/error.rs: macro_rules! declare_err {
          declare_err!(ENOEXEC, "Exec format error.");
          declare_err!(EBADF, "Bad file number.");
     -    declare_err!(ECHILD, "Exec format error.");
    -+    declare_err!(ECHILD, "No child process.");
    ++    declare_err!(ECHILD, "No child processes.");
          declare_err!(EAGAIN, "Try again.");
          declare_err!(ENOMEM, "Out of memory.");
          declare_err!(EACCES, "Permission denied.");