From fc92e197f870c2f161035fd0c90da5a3ae361be3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 26 Sep 2008 14:30:03 +0200 Subject: [PATCH] Applying Suses dosfstools-2.11-o_excl.patch from Pavol Rusnak to use O_EXCL in mkdosfs: * mkdosfs now opens device with O_EXCL [#238687] Signed-off-by: Daniel Baumann --- mkdosfs/mkdosfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkdosfs/mkdosfs.c b/mkdosfs/mkdosfs.c index 99bdf45..9745837 100644 --- a/mkdosfs/mkdosfs.c +++ b/mkdosfs/mkdosfs.c @@ -1675,7 +1675,7 @@ main (int argc, char **argv) if (!create) { check_mount (device_name); /* Is the device already mounted? */ - dev = open (device_name, O_RDWR); /* Is it a suitable device to build the FS on? */ + dev = open (device_name, O_EXCL|O_RDWR); /* Is it a suitable device to build the FS on? */ if (dev < 0) die ("unable to open %s"); } @@ -1683,7 +1683,7 @@ main (int argc, char **argv) off_t offset = blocks*BLOCK_SIZE - 1; char null = 0; /* create the file */ - dev = open( device_name, O_RDWR|O_CREAT|O_TRUNC, 0666 ); + dev = open( device_name, O_EXCL|O_RDWR|O_CREAT|O_TRUNC, 0666 ); if (dev < 0) die("unable to create %s"); /* seek to the intended end-1, and write one byte. this creates a