#include <string.h>
#include "data/dataset.h"
-#include "data/file-name.h"
#include "data/variable.h"
#include "libpspp/cast.h"
#include "libpspp/compiler.h"
/* Hash table of all active locks. */
static struct hmap locks = HMAP_INITIALIZER (locks);
-struct file_identity *fh_get_identity (const struct file_handle *);
+static struct file_identity *fh_get_identity (const struct file_handle *);
static void fh_free_identity (struct file_identity *);
static int fh_compare_file_identities (const struct file_identity *,
const struct file_identity *);
return NULL;
}
lock->open_cnt++;
-
+
free_key (key);
free (key);
/* Returns a pointer to a dynamically allocated structure whose
value can be used to tell whether two files are actually the
- same file. Returns a null pointer if no information about the
- file is available, perhaps because it does not exist. The
- caller is responsible for freeing the structure with
+ same file. The caller is responsible for freeing the structure with
fh_free_identity() when finished. */
-struct file_identity *
+static struct file_identity *
fh_get_identity (const struct file_handle *fh)
{
struct file_identity *identity = xmalloc (sizeof *identity);
const char *file_name = fh_get_file_name (fh);
-
+
#if !(defined _WIN32 || defined __WIN32__)
struct stat s;
if (lstat (file_name, &s) == 0)
size_t bufsize;
size_t pathlen = 255;
char *cname = NULL;
- do
+ do
{
bufsize = pathlen;
cname = xrealloc (cname, bufsize);