]> git.meshlink.io Git - catta/commitdiff
add new error code AVAHI_ERR_IS_EMPTY and use it in avahi_entry_group_commit()
authorLennart Poettering <lennart@poettering.net>
Mon, 30 Jan 2006 20:57:58 +0000 (20:57 +0000)
committerLennart Poettering <lennart@poettering.net>
Mon, 30 Jan 2006 20:57:58 +0000 (20:57 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1124 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-common/dbus.c
avahi-common/dbus.h
avahi-common/error.c
avahi-common/error.h
avahi-core/entry.c

index 814016483ecd1169f518d378725b720775c20fdf..e044b5325d697f62307d806a32c72371a8851e9b 100644 (file)
@@ -87,7 +87,8 @@ static const char * const table[- AVAHI_ERR_MAX] = {
     AVAHI_DBUS_ERR_NOT_SUPPORTED,
 
     AVAHI_DBUS_ERR_NOT_PERMITTED,
-    AVAHI_DBUS_ERR_INVALID_ARGUMENT
+    AVAHI_DBUS_ERR_INVALID_ARGUMENT,
+    AVAHI_DBUS_ERR_IS_EMPTY
 };
 
 struct error_map {
index 84d5d2d4a3919a866d0aced3eba12a773a1a16a7..39718d1b3993b0220c8b990a7fe2bc6e1d3982d2 100644 (file)
@@ -88,7 +88,7 @@ Avahi 0.6.1 implements API version 0x0202 */
 #define AVAHI_DBUS_ERR_VERSION_MISMATCH "org.freedesktop.Avahi.VersionMismatchError"
 #define AVAHI_DBUS_ERR_INVALID_SERVICE_SUBTYPE "org.freedesktop.Avahi.InvalidServiceSubtypeError"
 #define AVAHI_DBUS_ERR_INVALID_PACKET "org.freedesktop.Avahi.InvalidPacketError"
-#define AVAHI_DBUS_ERR_INVALID_DNS_ERROR "org.freedesktop.Avahi.InvalidDNSError"
+#define AVAHI_DBUS_ERR_INVALID_DNS_ERROR "org.freedesktop.Avahi.InvalidDNSErrorError"
 #define AVAHI_DBUS_ERR_DNS_FORMERR "org.freedesktop.Avahi.DNSFORMERR"
 #define AVAHI_DBUS_ERR_DNS_SERVFAIL "org.freedesktop.Avahi.DNSSERVFAIL"
 #define AVAHI_DBUS_ERR_DNS_NXDOMAIN "org.freedesktop.Avahi.DNSNXDOMAIN"
@@ -106,8 +106,8 @@ Avahi 0.6.1 implements API version 0x0202 */
 #define AVAHI_DBUS_ERR_NOT_SUPPORTED "org.freedesktop.Avahi.NotSupportedError"
 
 #define AVAHI_DBUS_ERR_NOT_PERMITTED "org.freedesktop.Avahi.NotPermittedError"
-#define AVAHI_DBUS_ERR_INVALID_ARGUMENT "org.freedesktop.Avahi.InvalidArgument"
-
+#define AVAHI_DBUS_ERR_INVALID_ARGUMENT "org.freedesktop.Avahi.InvalidArgumentError"
+#define AVAHI_DBUS_ERR_IS_EMPTY "org.freedesktop.Avahi.IsEmptyError"
 
 /** Convert a DBus error string into an Avahi error number */
 int avahi_error_dbus_to_number(const char *s);
index 6fe981cf0f1fa14b595473b2974f9db9217e443a..f6f561a6a510b34fb95513d689e419783c6f0535 100644 (file)
@@ -84,7 +84,8 @@ const char *avahi_strerror(int error) {
         "Not supported",
 
         "Not permitted",
-        "Invalid argument"
+        "Invalid argument",
+       "Is empty"
     };
 
     if (-error < 0 || -error >= -AVAHI_ERR_MAX)
index 8060ebcfbfd454288641955c41ac298ad3b6a050..2cf3bc2bf1bb2eda7183840302c57364f211995a 100644 (file)
@@ -87,6 +87,7 @@ enum {
     
     AVAHI_ERR_NOT_PERMITTED = -50,           /**< Operation not permitted */
     AVAHI_ERR_INVALID_ARGUMENT = -51,        /**< Invalid argument */
+    AVAHI_ERR_IS_EMPTY = -52,                /**< Is empty */
     
     /****
      ****    IF YOU ADD A NEW ERROR CODE HERE, PLEASE DON'T FORGET TO ADD
@@ -96,7 +97,7 @@ enum {
      ****    Also remember to update the MAX value below.
      ****/
     
-    AVAHI_ERR_MAX = -52
+    AVAHI_ERR_MAX = -53
 };
 
 /** Return a human readable error string for the specified error code */
index eb745f208aab5e7d35959672f98603a5e74a6df9..d953f7b33000844fe4bb61948f71153bf2520877 100644 (file)
@@ -1114,7 +1114,7 @@ int avahi_s_entry_group_commit(AvahiSEntryGroup *g) {
         return avahi_server_set_errno(g->server, AVAHI_ERR_BAD_STATE);
 
     if (avahi_s_entry_group_is_empty(g))
-        return avahi_server_set_errno(g->server, AVAHI_ERR_BAD_STATE);
+        return avahi_server_set_errno(g->server, AVAHI_ERR_IS_EMPTY);
 
     g->n_register_try++;