commit 31e59616e044a57c3829a225239160a5bd1dcba1
parent 2f72652bb94e8b1c9b4fd5fde5be2b38e922886e
Author: Russ Cox <rsc@swtch.com>
Date: Tue, 22 Dec 2009 08:42:27 -0800
9vx: make fscreate exclusive, as per 9P
R=rsc
http://codereview.appspot.com/180116
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/9vx/devfs-posix.c b/src/9vx/devfs-posix.c
@@ -480,7 +480,7 @@ fscreate(Chan *c, char *name, int mode, ulong perm)
mm = mode & 3;
if(mode & OTRUNC)
mm |= O_TRUNC;
- if((fd = open(path, mm|O_CREAT, 0666)) < 0)
+ if((fd = open(path, mm|O_CREAT|O_EXCL, 0666)) < 0)
oserror();
// Be like Plan 9 file servers: inherit mode bits
// and group from parent.