From: Joel Rosdahl Date: Mon, 3 Jan 2011 21:53:12 +0000 (+0100) Subject: Merge branch 'maint' X-Git-Tag: v3.2~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=001bf3c93d734606753eacd515f0eb73fe7da3c8;p=thirdparty%2Fccache.git Merge branch 'maint' * maint: Cope with file systems (e.g. FAT) that don't handle symlinks Close file handle in create_cachedirtag on write error Conflicts: lockfile.c --- 001bf3c93d734606753eacd515f0eb73fe7da3c8 diff --cc lockfile.c index 404e5c1c6,1e1d0afe6..abff063b3 --- a/lockfile.c +++ b/lockfile.c @@@ -106,13 -99,14 +106,21 @@@ lockfile_acquire(const char *path, unsi goto out; } cc_log("lockfile_acquire: symlink %s: %s", lockfile, strerror(errno)); + if (errno == ENOENT) { + /* Directory doesn't exist? */ + if (create_parent_dirs(lockfile) == 0) { + /* OK. Retry. */ + continue; + } + } + if (errno == EPERM) { + /* + * The file system does not support symbolic links. We have no choice but + * to grant the lock anyway. + */ + acquired = true; + goto out; + } if (errno != EEXIST) { /* Directory doesn't exist or isn't writable? */ goto out;