linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 3 btrfs-progs minor patches
@ 2008-04-05 18:48 Miguel Sousa Filipe
  0 siblings, 0 replies; only message in thread
From: Miguel Sousa Filipe @ 2008-04-05 18:48 UTC (permalink / raw)
  To: linux-btrfs, btrfs-devel

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

Hi there,

I have a few patches for some minor things:
- in btrfsctl.c , when no commands are given, call print_usage().
- some cast error fixes (since we're compiling with -Werror) in some printfs.
- in Makefile, use $(CC) to link, since its probably better to link
the files with the same compiler that produced that .o files.

Kind regards,

-- 
Miguel Sousa Filipe

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: btrfsctl_print_usage.patch --]
[-- Type: text/x-patch; name=btrfsctl_print_usage.patch, Size: 578 bytes --]

# HG changeset patch
# User Miguel Sousa Filipe <miguel.filipe@gmail.com>
# Date 1207420850 -3600
# Node ID 4483ce5e7c390db4a7accd04f0fd7e091dd7ae9a
# Parent  1664655d2c7cd41b1ec06fb5d57aaccaf366b6a1
btrfsctl: print usage when no commands are given

diff -r 1664655d2c7c -r 4483ce5e7c39 btrfsctl.c
--- a/btrfsctl.c	Sat Apr 05 19:34:43 2008 +0100
+++ b/btrfsctl.c	Sat Apr 05 19:40:50 2008 +0100
@@ -119,7 +119,7 @@ int main(int ac, char **av)
 		}
 	}
 	if (command == 0) {
-		fprintf(stderr, "no valid commands given\n");
+		print_usage();
 		exit(1);
 	}
 	fname = av[ac - 1];

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: cast_errors.patch --]
[-- Type: text/x-patch; name=cast_errors.patch, Size: 1179 bytes --]

# HG changeset patch
# User Miguel Sousa Filipe <miguel.filipe@gmail.com>
# Date 1207420364 -3600
# Node ID dbee3b070f8697e6f7705ee5714f837456680d8d
# Parent  ff33a2f118bf47b2e6a103df9c2bf11f210955fa
Fix printf format casting errors

diff -r ff33a2f118bf -r dbee3b070f86 btrfsck.c
--- a/btrfsck.c	Fri Apr 04 15:42:17 2008 -0400
+++ b/btrfsck.c	Sat Apr 05 19:32:44 2008 +0100
@@ -134,7 +134,7 @@ static int check_leaf(struct btrfs_root 
 		    BTRFS_LEAF_DATA_SIZE(root)) {
 			fprintf(stderr, "bad item end %u wanted %lu\n",
 				btrfs_item_end_nr(buf, i),
-				BTRFS_LEAF_DATA_SIZE(root));
+				(unsigned long) BTRFS_LEAF_DATA_SIZE(root));
 			return 1;
 		}
 	}
diff -r ff33a2f118bf -r dbee3b070f86 btrfsctl.c
--- a/btrfsctl.c	Fri Apr 04 15:42:17 2008 -0400
+++ b/btrfsctl.c	Sat Apr 05 19:32:44 2008 +0100
@@ -137,7 +137,7 @@ int main(int ac, char **av)
 		fd = dirfd(dirstream);
 	} else if (command == BTRFS_IOC_SCAN_DEV) {
 		fd = open("/dev/btrfs-control", O_RDWR);
-		printf("scanning %s command %lu\n", fname, BTRFS_IOC_SCAN_DEV);
+		printf("scanning %s command %lu\n", fname, (unsigned long) BTRFS_IOC_SCAN_DEV);
 		name = fname;
 	} else {
 		fd = open(fname, O_RDWR);

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: use_CC_to_link.patch --]
[-- Type: text/x-patch; name=use_CC_to_link.patch, Size: 1775 bytes --]

# HG changeset patch
# User Miguel Sousa Filipe <miguel.filipe@gmail.com>
# Date 1207420483 -3600
# Node ID 1664655d2c7cd41b1ec06fb5d57aaccaf366b6a1
# Parent  dbee3b070f8697e6f7705ee5714f837456680d8d
Use $(CC) to link binaries.

diff -r dbee3b070f86 -r 1664655d2c7c Makefile
--- a/Makefile	Sat Apr 05 19:32:44 2008 +0100
+++ b/Makefile	Sat Apr 05 19:34:43 2008 +0100
@@ -32,25 +32,25 @@ all: $(progs)
 all: $(progs)
 
 btrfsctl: $(objects) btrfsctl.o
-	gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
 
 btrfsck: $(objects) btrfsck.o bit-radix.o
-	gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS) $(LIBS)
 
 mkfs.btrfs: $(objects) mkfs.o
-	gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS)
 
 debug-tree: $(objects) debug-tree.o
-	gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS)
 
 dir-test: $(objects) dir-test.o
-	gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
 
 quick-test: $(objects) quick-test.o
-	gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
 
 convert: $(objects) convert.o
-	gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS)
+	$(CC) $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS)
 
 clean :
 	rm -f $(progs) cscope.out *.o .*.d btrfs-convert

[-- Attachment #5: Type: text/plain, Size: 151 bytes --]

_______________________________________________
Btrfs-devel mailing list
Btrfs-devel@oss.oracle.com
http://oss.oracle.com/mailman/listinfo/btrfs-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-05 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-05 18:48 [PATCH] 3 btrfs-progs minor patches Miguel Sousa Filipe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).