[syslinux] would like more detail when /tmp directory is missing. patch for linux/syslinux.c

George David george at miamisalsa.com
Mon Jun 21 15:16:58 PDT 2010


Our linux distribution at my job didn't include a /tmp directory. When ever
I tried to use syslinux, I would get the following error:

./syslinux: No such file or directory

I modified the code to report this:

./syslinux: Cannot access the /tmp/ directory.

This would have helped me a lot rather than having to download the source
and run it through the debugger to figure out that my /tmp/ directory was
missing. I suspect if this ever happens again I'll know exactly what was
wrong, but hopefully it will help someone else.

Below is the output of diff -up

Thanks!
George

--- linux/syslinux.c.orig 2010-06-21 15:04:49.000000000 -0600
+++ linux/syslinux.c 2010-06-21 15:58:05.000000000 -0600
@@ -421,7 +421,8 @@ int main(int argc, char *argv[])
    Make a temp dir and pass all the gunky options to mount. */

  if (chdir(_PATH_TMP)) {
-    perror(program);
+    fprintf(stderr, "%s: Cannot access the %s directory.\n",
+                    program, _PATH_TMP);
     exit(1);
  }
 #define TMP_MODE (S_IXUSR|S_IWUSR|S_IXGRP|S_IWGRP|S_IWOTH|S_IXOTH|S_ISVTX)



More information about the Syslinux mailing list