summaryrefslogtreecommitdiff
path: root/linux-uml/linux-uml-2.4.26/10-flock.patch
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-11-09 00:36:47 +0000
committerChris Larson <clarson@kergoth.com>2004-11-09 00:36:47 +0000
commitf96441b9faf769c9ecdd4d338b605ea3d0cc4010 (patch)
treeedb17ec2c4ea13c5acb1c7350957a249a820e28d /linux-uml/linux-uml-2.4.26/10-flock.patch
parentb6588aa6851fb220cedc387d21c51513ef8d67f4 (diff)
Disable bk EOLN_NATIVE conversions on all files in packages FILESPATHs, to prevent it screwing up patches.
BKrev: 4190111fA4MuVozAqwE7xOSL9fr-TA
Diffstat (limited to 'linux-uml/linux-uml-2.4.26/10-flock.patch')
-rw-r--r--linux-uml/linux-uml-2.4.26/10-flock.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/linux-uml/linux-uml-2.4.26/10-flock.patch b/linux-uml/linux-uml-2.4.26/10-flock.patch
index e69de29bb2..c64b34d8be 100644
--- a/linux-uml/linux-uml-2.4.26/10-flock.patch
+++ b/linux-uml/linux-uml-2.4.26/10-flock.patch
@@ -0,0 +1,33 @@
+Index: linux-2.4.24-2/arch/um/os-Linux/file.c
+--- linux-2.4.24-2/arch/um/os-Linux/file.c 7 Apr 2004 20:44:49 -0000 1.29
++++ linux-2.4.24-2/arch/um/os-Linux/file.c 17 May 2004 18:35:49 -0000
+@@ -688,6 +688,7 @@
+
+ int os_lock_file(int fd, int excl)
+ {
++#if USE_FCNTL_LOCK
+ int type = excl ? F_WRLCK : F_RDLCK;
+ struct flock lock = ((struct flock) { .l_type = type,
+ .l_whence = SEEK_SET,
+@@ -710,6 +711,21 @@
+ err = save;
+ out:
+ return(err);
++#else
++ int type = excl ? LOCK_EX : LOCK_SH;
++ int err, save;
++
++ err = flock(fd, type | LOCK_NB);
++ if(!err)
++ goto out;
++
++ save = -errno;
++
++ printk("file already locked\n");
++ err = save;
++ out:
++ return(err);
++#endif
+ }
+
+ int os_ftruncate(int fd, __u64 size)