Subject: Fw: CVS commit: pkgsrc/sysutils/fam
To: None <>
From: Julio M. Merino Vidal <>
List: tech-userlevel
Date: 04/18/2004 19:23:58
Hi all,

WRT to this, which system is right?  It may be that...

1) putenv("TMPDIR=") in NetBSD leaves the variable defined in the
   environment, but with an empty value, while the same call in linux leaves
   the variable undefined.


2) maybe the problem is that tempnam in linux will consider an empty value
   of TMPDIR as unset, while in NetBSD the empty value is considered as / ?


Begin forwarded message:

Date: Sun, 18 Apr 2004 17:11:08 +0000 (UTC)
From: "Julio M. Merino Vidal" <>
Subject: CVS commit: pkgsrc/sysutils/fam

Module Name:	pkgsrc
Committed By:	jmmv
Date:		Sun Apr 18 17:11:08 UTC 2004

Modified Files:
	pkgsrc/sysutils/fam: Makefile distinfo
	pkgsrc/sysutils/fam/patches: patch-aa patch-aj patch-ax

Log Message:
Fix location of temporary files, as they were beeing created under / instead
of /tmp!  If you have been using GNOME, you may want to 'rm -f /.fam*' to
clean them up.

The problem is caused by two different issues, related to a call to tempnam:

- The code uses a HAVE_UNSETENV define to check if the unsetenv function
  is available; however, the configure script does not check for it, so
  unsetenv is never used.  Fix the configure script to check for unsetenv.

- If unsetenv is not available, it does putenv("TMPDIR=") before calling
  tempnam.  The code expects that this call *unsets* the variable from the
  environment (which happens in Linux), but instead it is *set* to an empty
  value, causing the creation of files in the root directory.  Fix this by
  explicitly setting TMPDIR to /tmp.


To generate a diff of this commit:
cvs rdiff -r1.14 -r1.15 pkgsrc/sysutils/fam/Makefile
cvs rdiff -r1.11 -r1.12 pkgsrc/sysutils/fam/distinfo
cvs rdiff -r1.5 -r1.6 pkgsrc/sysutils/fam/patches/patch-aa \
cvs rdiff -r1.7 -r1.8 pkgsrc/sysutils/fam/patches/patch-ax

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Julio M. Merino Vidal <>
The NetBSD Project -