diff options
author | Doug Ledford <dledford@redhat.com> | 2008-07-24 18:35:11 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2008-07-24 18:35:11 -0400 |
commit | fb97b4d691c04d9303571d7eba3cef4a97264e2f (patch) | |
tree | f2ecbee4bd0d262c6a92ac631c642458921f1d8b /mdopen.c | |
parent | 0bc38b50205db04cd842c5009467a57b1ee1c293 (diff) | |
download | mdadm-fb97b4d691c04d9303571d7eba3cef4a97264e2f.tar.gz mdadm-fb97b4d691c04d9303571d7eba3cef4a97264e2f.tar.xz mdadm-fb97b4d691c04d9303571d7eba3cef4a97264e2f.zip |
Clean up usage of open()
Fix on call that passed an invalid mode to open
Don't pass a third arg unless we also pass O_CREAT
Use symbolic args for 2nd and 3rd args
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'mdopen.c')
-rw-r--r-- | mdopen.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -173,7 +173,7 @@ int open_mddev(char *dev, int autof) must_remove = 1; if (stb.st_mode && !must_remove) { /* looks ok, see if it is available */ - mdfd = open(dev, O_RDWR, 0); + mdfd = open(dev, O_RDWR); if (mdfd < 0) { fprintf(stderr, Name ": error opening %s: %s\n", dev, strerror(errno)); @@ -254,7 +254,7 @@ int open_mddev(char *dev, int autof) make_parts(dev,parts, ci->symlinks); } } - mdfd = open(dev, O_RDWR, 0); + mdfd = open(dev, O_RDWR); if (mdfd < 0) fprintf(stderr, Name ": error opening %s: %s\n", dev, strerror(errno)); |