From: Lennart Poettering Date: Thu, 11 Aug 2005 19:30:19 +0000 (+0000) Subject: It is a bad idea to name your own variables "errno". On some system the libc defines... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=1d04f36afcc6035e2373a39aa2c41f4e29afb748;p=catta It is a bad idea to name your own variables "errno". On some system the libc defines this as a macro, so you get into strange difficulties. I renamed those variables to "error" wherever this applies. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@294 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-client/client.c b/avahi-client/client.c index 46b7b37..49ace50 100644 --- a/avahi-client/client.c +++ b/avahi-client/client.c @@ -41,13 +41,13 @@ #include "internal.h" int -avahi_client_set_errno (AvahiClient *client, int errno) +avahi_client_set_errno (AvahiClient *client, int error) { - if (client == NULL) return errno; + if (client == NULL) return error; - client->errno = errno; + client->error = error; - return errno; + return error; } static diff --git a/avahi-client/entrygroup.c b/avahi-client/entrygroup.c index 6c0613f..7e8f74e 100644 --- a/avahi-client/entrygroup.c +++ b/avahi-client/entrygroup.c @@ -181,7 +181,7 @@ avahi_entry_group_state (AvahiEntryGroup *group) int avahi_client_errno (AvahiClient *client) { - return client->errno; + return client->error; } AvahiClient* diff --git a/avahi-client/internal.h b/avahi-client/internal.h index 64ba919..ad39af3 100644 --- a/avahi-client/internal.h +++ b/avahi-client/internal.h @@ -27,7 +27,7 @@ struct _AvahiClient { DBusConnection *bus; - int errno; + int error; AvahiClientCallback callback; void *user_data; AVAHI_LLIST_HEAD(AvahiEntryGroup, groups); @@ -59,7 +59,7 @@ struct _AvahiServiceTypeBrowser { AVAHI_LLIST_FIELDS(AvahiServiceTypeBrowser, service_type_browsers); }; -int avahi_client_set_errno (AvahiClient *client, int errno); +int avahi_client_set_errno (AvahiClient *client, int error); void avahi_entry_group_state_change (AvahiEntryGroup *group, int state);