All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH V2] xfstests: fix nr of args in open calls
Date: Sat, 25 Oct 2008 22:45:59 -0500	[thread overview]
Message-ID: <4903E7F7.9010608@sandeen.net> (raw)
In-Reply-To: <49036961.8070100@sandeen.net>

Fix a few problematic open calls which strict checking catches;
in most cases just missing a mode with O_CREAT.

Removed the #ifdef CRAY instance around one, per hch's request.

Somebody else can remove the rest, when motivated.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

Index: xfstests/ltp/iogen.c
===================================================================
--- xfstests.orig/ltp/iogen.c
+++ xfstests/ltp/iogen.c
@@ -1060,7 +1060,7 @@ int 	nbytes;
 
     Oflags |= O_CREAT | O_WRONLY;
 
-    if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
+    if ((fd = open(path, Oflags, 0666)) == -1) {
 	fprintf(stderr, "iogen%s:  Could not create/open file %s: %s (%d)\n",
 		TagName, path, SYSERR, errno);
 	return -1;
Index: xfstests/src/multi_open_unlink.c
===================================================================
--- xfstests.orig/src/multi_open_unlink.c
+++ xfstests/src/multi_open_unlink.c
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
 			return 1;
 		}
 
-		fd = open(path, O_RDWR|O_CREAT|O_EXCL);
+		fd = open(path, O_RDWR|O_CREAT|O_EXCL, 0666);
 		if (fd == -1) {
 			fprintf(stderr, "%s: failed to create \"%s\": %s\n", prog, path, strerror(errno));
 			return 1;
Index: xfstests/src/enospc_unlink.c
===================================================================
--- xfstests.orig/src/enospc_unlink.c
+++ xfstests/src/enospc_unlink.c
@@ -40,7 +40,7 @@ int main(int argc, char **argv)
 	memset(ptr, 0xffffffff, sz);
 
 	for (i = 0; i < count; i++) {
-		fd = open(argv[1], O_CREAT|O_WRONLY);
+		fd = open(argv[1], O_CREAT|O_WRONLY, 0666);
 		if (fd < 0) {
 			perror(argv[1]);
 			exit(1);
Index: xfstests/src/dmiperf.c
===================================================================
--- xfstests.orig/src/dmiperf.c
+++ xfstests/src/dmiperf.c
@@ -203,7 +203,7 @@ mkfile(char *name, char *attr)
 	ssize_t		wrote, wsize;
 	off64_t		bytes = fsize;
 
-	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT)) < 0) {
+	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT, 0666)) < 0) {
 		perror("open");
 		exit(1);
 	}

  parent reply	other threads:[~2008-10-26  3:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25 18:45 [PATCH] xfstests: fix nr of args in open calls Eric Sandeen
2008-10-25 20:17 ` Christoph Hellwig
2008-10-25 20:19   ` Eric Sandeen
2008-10-25 20:22     ` Christoph Hellwig
2008-10-26  3:45 ` Eric Sandeen [this message]
2008-11-12  9:58   ` [PATCH V2] " Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4903E7F7.9010608@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.