--- ./Makefile.jbj	2005-08-27 19:33:06.000000000 -0400
+++ ./Makefile	2005-08-27 19:33:42.000000000 -0400
@@ -5,7 +5,7 @@
 DESTDIR=/
 PYTHON=python
 
-prefix=/usr
+prefix=@@PREFIX@@
 bindir=$(prefix)/bin
 
 all:
--- ./smart/const.py.jbj	2005-08-27 19:28:52.000000000 -0400
+++ ./smart/const.py	2005-08-27 19:30:30.000000000 -0400
@@ -64,9 +64,9 @@
 
 BLOCKSIZE = 16384
 
-DISTROFILE  = "/usr/lib/smart/distro.py"
-PLUGINSDIR  = "/usr/lib/smart/plugins/"
-DATADIR     = "/var/lib/smart/"
+DISTROFILE  = "@@PREFIX@@/lib/smart/distro.py"
+PLUGINSDIR  = "@@PREFIX@@/lib/smart/plugins/"
+DATADIR     = "@@PREFIX@@/var/lib/smart/"
 USERDATADIR = "~/.smart/"
 CONFFILE    = "config"
 
--- ./smart/util/filetools.py.jbj	2005-08-27 19:27:09.000000000 -0400
+++ ./smart/util/filetools.py	2005-08-27 19:28:33.000000000 -0400
@@ -65,7 +65,10 @@
         pass
 
 def setCloseOnExecAll():
-    for fd in range(3,resource.getrlimit(resource.RLIMIT_NOFILE)[1]):
+    nfmax = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
+    if nfmax > 4096:
+	nfmax = 4096
+    for fd in range(3,nfmax):
         try:
             flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
             flags |= fcntl.FD_CLOEXEC
