Skip to contentSkip to conversation

xfsdump: cleanup _rmt_dev

PATCH In review Christoph Hellwig 1 participant 2 messages Dec 6, 2008 – Dec 9, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsdump: cleanup _rmt_dev

Rewrite _rmt_dev to be proper ANSI C and readable.

xfsdump/librmt/rmtdev.c +7 -13
Index: xfs-cmds/xfsdump/librmt/rmtdev.c
===================================================================
@@ -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;
+}

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs