Subject: [Tools-discuss] Rfcdiff-1.41: Patch for temp directories

From: Andrey Ponomarenko <[email-masked]>
Date: Thu, 29 Sep 2011 14:10:00 +0400

There is a problem with creating tmp directories in Rfcdiff-1.41 when 
using it hundreds times together:

/usr/bin/rfcdiff: Error: Failed to create temporary directory 
'/tmp/rfcdiff-28949'.
/usr/bin/rfcdiff: Error: Failed to create temporary directory 
'/tmp/rfcdiff-29011'.

Patch to fix this problem:

--- rfcdiff    2011-09-29 14:06:27.000000000 +0400
+++ rfcdiff     2011-09-29 14:06:27.000000000 +0400
@@ -106,7 +106,7 @@
  export progdate=""
  export prelines="10"
  export basename=$(basename $0)
-export workdir="/tmp/$basename-$$"
+export workdir=`mktemp -d`
  export pagecache1="$workdir/pagecache1"
  export pagecache2="$workdir/pagecache2"

@@ -847,7 +847,6 @@
  # ----------------------------------------------------------------------
  # create working directory.
  # ----------------------------------------------------------------------
-mkdir $workdir || die "$0: Error: Failed to create temporary directory 
'$workdir'."
  mkdir $workdir/1 || die "$0: Error: Failed to create temporary 
directory '$workdir/1'."
  mkdir $workdir/2 || die "$0: Error: Failed to create temporary 
directory '$workdir/2'."

-- 
Andrey Ponomarenko
Department for Operating Systems at ISPRAS
  web:    http://www.LinuxTesting.org
  mail:   [email-masked]