* details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
#include <sys/types.h>
#include <unistd.h>
-#include <malloc.h>
#include <sys/utsname.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
+#include <stdint.h>
#ifdef NLS16
#include <limits.h>
#define QtB(a) _DtShmProtoAddStrtab(shm_handle, XrmQuarkToString(a), &isnew)
+/* DtsMM.c */
+extern int _DtDtsMMPathHash(DtDirPaths *dirs);
+
+
int
_MMWriteDb(DtDirPaths *dirs, int num_db, DtDtsDbDatabase **db_list,
const char *CacheFile)
mtime_list[count-1] = buf.st_mtime;
boson_list[count-1] = _DtShmProtoAddStrtab(shm_handle,
pathname, &isnew);
- if (pathname) free(pathname);
+ free(pathname);
continue;
}
}
data = _DtShmProtoAddIntLst(int_handle, count*sizeof(time_t)/sizeof(int), &header->mtimes_offset);
memcpy(data, mtime_list, count*sizeof(time_t));
header->files_count = count;
- if(boson_list)free(boson_list);
- if(mtime_list)free(mtime_list);
+ free(boson_list);
+ free(mtime_list);
return;
}
&head->name_list_offset);
_DtShmProtoCopyInttab(indexList, space);
_DtShmProtoDestroyInttab(indexList);
- if(name_index)free(name_index);
- if(list_of_recs)free(list_of_recs);
- if(other)free(other);
+ free(name_index);
+ free(list_of_recs);
+ free(other);
return(index);
}
int fd;
mode_t cmask = umask((mode_t)077);
char *tmpfile;
- /* tempnam(3) is affected by the TMPDIR environment variable. */
- /* This creates problems for rename() is "tmpfile" and "cacheFile" */
- /* are on different file systems. Use tmpnam(3) to create the */
- /* unique file name instead. */
- char tmpnam_buf[L_tmpnam + 1];
if ((tmpfile = malloc(sizeof(_DTDTSMMTEMPDIR) +
sizeof(_DTDTSMMTEMPFILE) + 7)) == NULL) {
sprintf(tmpfile, "%s/%sXXXXXX", _DTDTSMMTEMPDIR, _DTDTSMMTEMPFILE);
fd = mkstemp(tmpfile);
- /*
- tmpfile = (char *)malloc(sizeof(_DTDTSMMTEMPDIR) +
- sizeof(_DTDTSMMTEMPFILE) + L_tmpnam + 3);
-
- tmpnam(tmpnam_buf);
- sprintf(tmpfile, "%s/%s%s", _DTDTSMMTEMPDIR, _DTDTSMMTEMPFILE,
- basename(tmpnam_buf));
-
- fd = open(tmpfile, O_RDWR|O_CREAT, 0600);
- */
umask(cmask);
if(fd == -1)
_DtSimpleError(
DtProgName, DtError, NULL,
(char*) tmpfile, NULL);
+ free(tmpfile);
return(0);
}
}
-_DtActionCompareRecordBoson(
+intptr_t _DtActionCompareRecordBoson(
DtDtsMMRecord *record1,
DtDtsMMRecord *record2 )
{
if (results)
return(results);
- return((int)record1 - (int)record2);
+ return((intptr_t)record1 - (intptr_t)record2);
}