Whamcloud - gitweb
LU-6534 tests: Fix build issue, missing mode on an open with O_CREAT 31/14631/2
authorColin Ian King <colin.king@canonical.com>
Tue, 28 Apr 2015 13:39:02 +0000 (14:39 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 12 May 2015 22:18:05 +0000 (22:18 +0000)
When building with gcc 4.9.2, we hit the following build
error:

In function ‘open’,
    inlined from ‘sendfile_copy’ at sendfile_grouplock.c:229:9:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call
to ‘__open_missing_mode’ declared with attribute error: open
with O_CREAT in second argument needs 3 arguments
    __open_missing_mode ();

..fix this with a mode of 0644

Change-Id: Ia06392228c960584e4a8262fac775078152d78d8
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-on: http://review.whamcloud.com/14631
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sendfile_grouplock.c

index 42d66a3..80b2da5 100644 (file)
@@ -226,7 +226,7 @@ static int sendfile_copy(const char *source, int source_gid,
                        source_gid, source, strerror(-rc));
        }
 
                        source_gid, source, strerror(-rc));
        }
 
-       fd_out = open(dest, O_WRONLY | O_TRUNC | O_CREAT);
+       fd_out = open(dest, O_WRONLY | O_TRUNC | O_CREAT, 0644);
        ASSERTF(fd_out >= 0, "creation failed for '%s': %s",
                dest, strerror(errno));
 
        ASSERTF(fd_out >= 0, "creation failed for '%s': %s",
                dest, strerror(errno));