Whamcloud - gitweb
b=19319
authoranserper <anserper>
Mon, 4 May 2009 20:03:34 +0000 (20:03 +0000)
committeranserper <anserper>
Mon, 4 May 2009 20:03:34 +0000 (20:03 +0000)
i=Alexander Zarochentsev

don't pass garbage in mode with O_CREAT

lustre/tests/multiop.c

index 0765c5f..a8de99b 100755 (executable)
@@ -318,7 +318,10 @@ int main(int argc, char **argv)
                 case 'o':
                         len = get_flags(commands+1, &flags);
                         commands += len;
-                        fd = open(fname, flags);
+                        if (flags & O_CREAT)
+                                fd = open(fname, flags, 0666);
+                        else
+                                fd = open(fname, flags);
                         if (fd == -1) {
                                 save_errno = errno;
                                 perror("open");