xfs
[Top] [All Lists]

[PATCH] xfsdump: cleanup _rmt_dev

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfsdump: cleanup _rmt_dev
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sat, 6 Dec 2008 05:27:09 -0500
User-agent: Mutt/1.5.18 (2008-05-17)
Rewrite _rmt_dev to be proper ANSI C and readable.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

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;
+}

<Prev in Thread] Current Thread [Next in Thread>