[PATCH 8/8] deprecate open("foo", 3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux