X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Ffile-handle-def.c;h=4c4820cb12a08fddfc025890fd1f02afd45bb035;hb=8180c5dd1591446174c0753ee960921786113403;hp=cdecfedfbc6028c6ede885d03dbecd60ec4fc841;hpb=1ce269be245e84fce66e071f195a28ac93ad8c54;p=pspp diff --git a/src/data/file-handle-def.c b/src/data/file-handle-def.c index cdecfedfbc..4c4820cb12 100644 --- a/src/data/file-handle-def.c +++ b/src/data/file-handle-def.c @@ -24,7 +24,6 @@ #include #include "data/dataset.h" -#include "data/file-name.h" #include "data/variable.h" #include "libpspp/cast.h" #include "libpspp/compiler.h" @@ -91,7 +90,7 @@ static void unname_handle (struct file_handle *); /* 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 *); @@ -523,7 +522,7 @@ fh_lock (struct file_handle *h, enum fh_referent mask UNUSED, return NULL; } lock->open_cnt++; - + free_key (key); free (key); @@ -704,13 +703,13 @@ struct file_identity value can be used to tell whether two files are actually the 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) @@ -762,7 +761,7 @@ fh_get_identity (const struct file_handle *fh) size_t bufsize; size_t pathlen = 255; char *cname = NULL; - do + do { bufsize = pathlen; cname = xrealloc (cname, bufsize);