[syslinux:master] linux installer: better error message for missing /tmp

syslinux-bot for George David george at miamisalsa.com
Mon Jun 21 15:51:13 PDT 2010


Commit-ID:  316baa765d85a91cd89585ea5cf913bcd2e478a5
Gitweb:     http://syslinux.zytor.com/commit/316baa765d85a91cd89585ea5cf913bcd2e478a5
Author:     George David <george at miamisalsa.com>
AuthorDate: Mon, 21 Jun 2010 16:16:58 -0600
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Mon, 21 Jun 2010 15:48:29 -0700

linux installer: better error message for missing /tmp

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.


---
 linux/syslinux.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/linux/syslinux.c b/linux/syslinux.c
index 7152d2b..fa500cf 100644
--- a/linux/syslinux.c
+++ b/linux/syslinux.c
@@ -344,7 +344,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-commits mailing list