summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-07-05 18:16:02 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-07-05 18:16:02 -0700
commit553ce5ef0813222dba2afd220114d00ff5a20d47 (patch)
tree7e16e7852632cc7ff1d92b238684386c63c7dd56
parent7973bad00a6a011d4b520c160c2cd89a506f3b99 (diff)
downloadsyslinux-553ce5ef0813222dba2afd220114d00ff5a20d47.tar.gz
mtools: slightly more obvious definition of tmpdir fallback
Make it a bit more obvious what actually happens for the tmpdir fallback. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--mtools/syslinux.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mtools/syslinux.c b/mtools/syslinux.c
index 761c31bf..76cd2ca4 100644
--- a/mtools/syslinux.c
+++ b/mtools/syslinux.c
@@ -198,16 +198,15 @@ int main(int argc, char *argv[])
* Temp directory of choice...
*/
tmpdir = getenv("TMPDIR");
+ if (!tmpdir) {
#ifdef P_tmpdir
- if (!tmpdir)
tmpdir = P_tmpdir;
-#endif
-#ifdef _PATH_TMP
- if (!tmpdir)
+#elif defined(_PATH_TMP)
tmpdir = _PATH_TMP;
-#endif
- if (!tmpdir)
+#else
tmpdir = "/tmp";
+#endif
+ }
/*
* First make sure we can open the device at all, and that we have