From: adilger Date: Thu, 12 Feb 2004 18:19:54 +0000 (+0000) Subject: Don't pass garbage mode bits to the filesystem with O_CREAT. X-Git-Tag: v1_7_100~2595 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=84460f79bade1f41cb8081af9d194c24e616e59c Don't pass garbage mode bits to the filesystem with O_CREAT. It is really the fault of K&R that there are 2 different open prototypes. --- diff --git a/lustre/tests/openfile.c b/lustre/tests/openfile.c index 81236b0..d494b4a4 100644 --- a/lustre/tests/openfile.c +++ b/lustre/tests/openfile.c @@ -53,7 +53,7 @@ int main(int argc, char** argv) { int fd; int flags=0; - mode_t mode=0; + mode_t mode=0644; char* fname=NULL; int mode_set=0; int flag_set=0; @@ -131,7 +131,7 @@ int main(int argc, char** argv) } - if (mode_set) + if (flags & O_CREAT) fd = open(fname, flags, mode); else fd = open(fname, flags);