All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] [PATCH] scripts: use mktemp instead of relying on TMPDIR beeing in env
@ 2015-10-27 12:21 Henning Schild
  2015-10-27 12:29 ` [Xenomai] [PATCH v2] " Henning Schild
  2015-10-27 12:30 ` [Xenomai] [PATCH] " Gilles Chanteperdrix
  0 siblings, 2 replies; 16+ messages in thread
From: Henning Schild @ 2015-10-27 12:21 UTC (permalink / raw)
  To: xenomai

The environment variable TMPDIR is optional and not always set. We could
test for it and fall back to /tmp/ or just use the tool mktemp.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 scripts/prepare-kernel.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/prepare-kernel.sh b/scripts/prepare-kernel.sh
index 8e960e8..c9bb815 100755
--- a/scripts/prepare-kernel.sh
+++ b/scripts/prepare-kernel.sh
@@ -238,9 +238,9 @@ fi
 # Create an empty output patch file, and initialize the temporary tree.
 if test "x$output_patch" != "x"; then
 
-    temp_tree=$TMPDIR/prepare-kernel-$$
-    if ! mkdir $temp_tree; then
-	echo Temporary directory $temp_tree already exists, aborting.
+    temp_tree=$( mktemp -d prepare-kernel-XXX )
+    if [ $? -ne 0 ]; then
+	echo Temporary directory could not be created.
 	exit 1
     fi
 
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-11-06 10:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 12:21 [Xenomai] [PATCH] scripts: use mktemp instead of relying on TMPDIR beeing in env Henning Schild
2015-10-27 12:29 ` [Xenomai] [PATCH v2] " Henning Schild
2015-10-27 12:30   ` [Xenomai] [PATCH v3] " Henning Schild
2015-10-27 12:32     ` Henning Schild
2015-10-27 12:30 ` [Xenomai] [PATCH] " Gilles Chanteperdrix
2015-10-27 12:35   ` Henning Schild
2015-10-28  8:33     ` Henning Schild
2015-10-28 10:51       ` Gilles Chanteperdrix
2015-10-28 11:15         ` [Xenomai] [PATCH v4] " Henning Schild
2015-10-28 11:26           ` Philippe Gerum
2015-11-04  7:53           ` Gilles Chanteperdrix
2015-11-05 10:31             ` Henning Schild
2015-11-05 10:55               ` Gilles Chanteperdrix
2015-11-05 18:22                 ` [Xenomai] [PATCH] scripts: increase number of Xs in mktemp template Henning Schild
2015-11-05 18:30                   ` Gilles Chanteperdrix
2015-11-06 10:33                     ` [Xenomai] [PATCHv2] " Henning Schild

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.