From 316baa765d85a91cd89585ea5cf913bcd2e478a5 Mon Sep 17 00:00:00 2001 From: George David Date: Mon, 21 Jun 2010 16:16:58 -0600 Subject: 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 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux/syslinux.c') diff --git a/linux/syslinux.c b/linux/syslinux.c index 7152d2bc..fa500cf7 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) -- cgit v1.2.1