summaryrefslogtreecommitdiff
path: root/locale/programs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-02-20 04:24:03 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-02-20 04:24:03 +0100
commitb177830ca29d226b36f0efcc6e10a9a4f722313c (patch)
treed78eb465191acc613c9d9282171fe640f4ffc19a /locale/programs
parent0234227d25807a330c27d549b9c17956a2f3fe35 (diff)
Fix installation of locales-all
Dirty hack to fix installation of locales-all: instead of just locking the archive extension (which is not supported on hurd-i386), lock it all.
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/locarchive.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index 770a731a61..4af9fe10fe 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -414,7 +414,16 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
}
/* Lock the new file. */
+#ifdef __GNU__
+ struct flock fl;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_type = F_WRLCK;
+ if (fcntl(fd, F_SETLKW, &fl) != 0)
+#else
if (lockf64 (fd, F_LOCK, total) != 0)
+#endif
{
int errval = errno;
unlink (fname);
@@ -560,7 +569,16 @@ open_archive (struct locarhandle *ah, bool readonly)
error (EXIT_FAILURE, errno, _("cannot stat locale archive \"%s\""),
archivefname);
+#ifdef __GNU__
+ struct flock fl;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_type = F_WRLCK;
+ if (!readonly && fcntl(fd, F_SETLKW, &fl) == -1)
+#else
if (!readonly && lockf64 (fd, F_LOCK, sizeof (struct locarhead)) == -1)
+#endif
{
close (fd);