[PATCH] xfsdump: cleanup _rmt_dev
Christoph Hellwig
hch at infradead.org
Sat Dec 6 04:27:09 CST 2008
Rewrite _rmt_dev to be proper ANSI C and readable.
Signed-off-by: Christoph Hellwig <hch at lst.de>
Index: xfs-cmds/xfsdump/librmt/rmtdev.c
===================================================================
--- xfs-cmds.orig/xfsdump/librmt/rmtdev.c 2008-11-25 16:39:45.000000000 +0530
+++ xfs-cmds/xfsdump/librmt/rmtdev.c 2008-11-25 16:41:06.000000000 +0530
@@ -28,18 +28,12 @@
* is any string that contains ":/dev/". Returns 1 if remote,
* 0 otherwise.
*/
-
-int _rmt_dev (path)
-register char *path;
+int _rmt_dev(char *path)
{
- if ((path = strchr (path, ':')) != (char *)0)
- {
- if (strncmp (path + 1, "/dev/", 5) == 0)
- {
- return (1);
- }
- }
- return (0);
-}
-
+ char *c;
+ c = strchr(path, ':');
+ if (c && strncmp(c + 1, "/dev/", 5) == 0)
+ return 1;
+ return 0;
+}
More information about the xfs
mailing list