[syslinux] [PATCH] extlinux/main.c: Silence warnings

Gene Cumm gene.cumm at gmail.com
Sat Jun 19 05:26:16 PDT 2010


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

extlinux/main.c: Silence warnings from GCC with asprintf's attribute
warn_unused_result in certain glibc versions/patches.  Assign it to a
variable and ignore it as the string is already tested for null before
using it.

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

---

diff --git a/extlinux/main.c b/extlinux/main.c
index 6ce3b60..a9645d0 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -512,8 +512,9 @@ int ext2_fat_install_file(const char *path, int
devfd, struct stat *rst)
     char *file;
     int fd = -1, dirfd = -1;
     int modbytes;
+    int ret;

-    asprintf(&file, "%s%sextlinux.sys",
+    ret = asprintf(&file, "%s%sextlinux.sys",
             path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/");
     if (!file) {
        perror(program);




More information about the Syslinux mailing list