summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-10 18:49:55 +0200
committerJim Meyering <meyering@redhat.com>2009-08-13 14:45:33 +0200
commit966dbd977f12b639169a48042b558834f627e5f8 (patch)
tree00e6a9c5484387f8fa6cef8a7ed3d90e8a588165
parentdd449ffba1a5fb3373d847ee1d7b26e9df3ccb1c (diff)
downloadlibguestfs-966dbd977f12b639169a48042b558834f627e5f8.tar.gz
libguestfs-966dbd977f12b639169a48042b558834f627e5f8.tar.xz
libguestfs-966dbd977f12b639169a48042b558834f627e5f8.zip
* daemon/daemon.h (RESOLVE_DEVICE): Rename from IS_DEVICE.
Change parameter from "errcode" (which would be returned) to "fail_stmt" so that a caller can specify e.g., "goto done" upon failure.
-rw-r--r--daemon/daemon.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h
index a6bbb732..166f3bf9 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -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