* daemon/daemon.h (RESOLVE_DEVICE): Rename from IS_DEVICE.
authorJim Meyering <meyering@redhat.com>
Mon, 10 Aug 2009 16:49:55 +0000 (18:49 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 13 Aug 2009 12:45:33 +0000 (14:45 +0200)
Change parameter from "errcode" (which would be returned) to "fail_stmt"
so that a caller can specify e.g., "goto done" upon failure.

daemon/daemon.h

index a6bbb73..166f3bf 100644 (file)
@@ -151,14 +151,14 @@ extern void reply (xdrproc_t xdrp, char *ret);
  *
  * NB. Cannot be used for FileIn functions.
  */
-#define IS_DEVICE(path,errcode)                                                \
+#define RESOLVE_DEVICE(path,fail_stmt)                                 \
   do {                                                                 \
     if (strncmp ((path), "/dev/", 5) != 0) {                           \
       reply_with_error ("%s: %s: expecting a device name", __func__, (path)); \
-      return (errcode);                                                        \
+      fail_stmt;                                                       \
     }                                                                  \
     if (device_name_translation ((path), __func__) == -1)              \
-      return (errcode);                                                        \
+      fail_stmt;                                                       \
   } while (0)
 
 /* Helper for functions which need either an absolute path in the