Deprecate access mode of '3' in open() as suggested by Linus.

Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]>

Index: linux/fs/open.c
===================================================================
--- linux.orig/fs/open.c        2005-08-23 13:15:49.000000000 +0200
+++ linux/fs/open.c     2005-08-23 13:16:15.000000000 +0200
@@ -756,6 +756,17 @@ struct file *filp_open(const char * file
 {
        int namei_flags, error;
        struct nameidata nd;
+       static int warned;
+
+       /*
+        * Access mode of 3 had some old uses, that are probably not
+        * applicable anymore.  For now just warn about deprecation.
+        * Later it can be changed to return -EINVAL.
+        */
+       if ((flags & O_ACCMODE) == 3 && warned < 5) {
+               warned++;
+               printk(KERN_WARNING "Warning: '%s' (pid=%i) uses deprecated 
open flags, please report!\n", current->comm, current->tgid);
+       }
 
        namei_flags = flags;
        if ((namei_flags+1) & O_ACCMODE)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to