Skip to contentSkip to conversation

util/grub-mkrescue: Fix copy/paste issue referencing mdadm

PATCH In review Glenn Washburn 3 participants 3 messages Nov 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util/grub-mkrescue: Fix copy/paste issue referencing mdadm

The check_xorriso() function appears to have been copy/pasted from somewhere that was originally checking the mdadm command. So the file handle to the output of the xorriso command is named 'mdadm'. Instead rename it to the more generic 'fout'. Also change a comment referencing mdadm to reference xorriso.

---
 util/grub-mkrescue.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
util/grub-mkrescue.c +5 -5
index 6dc71a8a1628..951b17b8edb9 100644
@@ -339,7 +339,7 @@ check_xorriso (const char *val)
   const char *argv[5];
   int fd;
   pid_t pid;
-  FILE *mdadm;
+  FILE *fout;
   char *buf = NULL;
   size_t len = 0;
   int ret = 0;
@@ -356,12 +356,12 @@ check_xorriso (const char *val)
   if (!pid)
     return 0;
 
-  /* Parent.  Read mdadm's output.  */
-  mdadm = fdopen (fd, "r");
-  if (! mdadm)
+  /* Parent.  Read xorriso's output.  */
+  fout = fdopen (fd, "r");
+  if (! fout)
     return 0;
 
-  while (getline (&buf, &len, mdadm) > 0)
+  while (getline (&buf, &len, fout) > 0)
     {
       if (grub_strstr (buf, val))
 	ret = 1;
Signature · 7 lines
2.34.1


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Glenn Washburn

The check_xorriso() function appears to have been copy/pasted from somewhere that was originally checking the mdadm command. So the file handle to the output of the xorriso command is named 'mdadm'. Instead rename it to the more generic 'fout'. Also change a comment referencing mdadm to reference xorriso.

Thanks,
Sudhakar

Quoted 42 lines

---
util/grub-mkrescue.c | 10 +++++-----

1 file changed, 5 insertions(+), 5 deletions(-)
util/grub-mkrescue.c +5 -5
index 6dc71a8a1628..951b17b8edb9 100644
@@ -339,7 +339,7 @@ check_xorriso (const char *val)
  const char *argv[5];
  int fd;
  pid_t pid;
-  FILE *mdadm;
+  FILE *fout;
  char *buf = NULL;
  size_t len = 0;
  int ret = 0;
@@ -356,12 +356,12 @@ check_xorriso (const char *val)
  if (!pid)
    return 0;
 
-  /* Parent.  Read mdadm's output.  */
-  mdadm = fdopen (fd, "r");
-  if (! mdadm)
+  /* Parent.  Read xorriso's output.  */
+  fout = fdopen (fd, "r");
+  if (! fout)
    return 0;
 
-  while (getline (&buf, &len, mdadm) > 0)
+  while (getline (&buf, &len, fout) > 0)
    {
      if (grub_strstr (buf, val))
 ret = 1;
Signature · 7 lines
2.34.1


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reviewed-by
#2 lore raw
Quoted 11 lines · Sudhakar Kuppusamy
Quoted 9 lines · Glenn Washburn

The check_xorriso() function appears to have been copy/pasted from somewhere that was originally checking the mdadm command. So the file handle to the output of the xorriso command is named 'mdadm'. Instead rename it to the more generic 'fout'. Also change a comment referencing mdadm to reference xorriso.

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel