[syslinux] [PATCH 1/2] COM32/opendir: remove unneeded zeroing

Gene Cumm gene.cumm at gmail.com
Thu Mar 5 18:42:10 PST 2009


From: Gene Cumm <gene.cumm at gmail.com>

COM32/opendir: remove unneeded zeroing; a member of DIR and errno were
zeroed unnecessarily

Signed-off-by: Gene Cumm <gene.cumm at gmail.com>

---

DIR is allocated with calloc() and errno shouldn't be zeroed unless I
set it and know I need to ignore it.  Depends on the string of patches
I've submitted this week


diff --git a/com32/lib/opendir.c b/com32/lib/opendir.c
index 5129273..fe2ee2e 100644
--- a/com32/lib/opendir.c
+++ b/com32/lib/opendir.c
@@ -44,8 +44,6 @@ DIR *opendir(const char *pathname)
 		strcpy(newdir->dd_name, pathname);
 		newdir->dd_fd = regs.esi.w[0];
 		newdir->dd_sect = regs.eax.l;
-		newdir->dd_stat = 0;
-		errno = 0;
 	} else {
 		/* ENOTDIR is another but a file must exist */
 		errno = ENOENT;




More information about the Syslinux mailing list