From 14da5003109dc261532bcce1766a86607be15733 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 22 Aug 2019 11:10:45 +1000 Subject: [PATCH] dbus: change EAGAIN to EBUSY for "already listening" Seems like a more precise description. Signed-off-by: Peter Hutterer --- DBusInterface.md | 6 +++--- tuhi/dbusserver.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DBusInterface.md b/DBusInterface.md index 09a5ee0..39a7615 100644 --- a/DBusInterface.md +++ b/DBusInterface.md @@ -79,7 +79,7 @@ org.freedesktop.tuhi1.Manager successful termination of the search process, either when a device has been registered or the timeout expired. - If the errno is -EAGAIN, the daemon is already searching for devices + If the errno is -EBUSY, the daemon is already searching for devices on behalf of another client. In this case, this client should wait for the Searching property to change and StartSearching() once the property is set to False. @@ -261,7 +261,7 @@ org.freedesktop.tuhi1.Device StopListening(). Otherwise, the argument is a negative errno indicating the type of error. - If the errno is -EAGAIN, the daemon is already listening to the device + If the errno is -EBUSY, the daemon is already listening to the device on behalf of another client. In this case, this client should wait for the Listening property to change and StartListening() once the property is set to False. @@ -288,7 +288,7 @@ org.freedesktop.tuhi1.Device StopLive(). Otherwise, the argument is a negative errno indicating the type of error. - If the errno is -EAGAIN, the daemon has already enabled live mode on + If the errno is -EBUSY, the daemon has already enabled live mode on device on behalf of another client. In this case, this client should wait for the Live property to change and StartLive() once the property is set to False. diff --git a/tuhi/dbusserver.py b/tuhi/dbusserver.py index 591b2f9..45db3dd 100755 --- a/tuhi/dbusserver.py +++ b/tuhi/dbusserver.py @@ -354,10 +354,10 @@ class TuhiDBusDevice(_TuhiDBus): if self.listening: logger.debug(f'{self} - already listening') - # silently ignore it for the current client but send EAGAIN to + # silently ignore it for the current client but send EBUSY to # other clients if sender != self._listening_client[0]: - status = GLib.Variant.new_int32(-errno.EAGAIN) + status = GLib.Variant.new_int32(-errno.EBUSY) self.signal('ListeningStopped', status, dest=sender) return @@ -404,10 +404,10 @@ class TuhiDBusDevice(_TuhiDBus): if self.live: logger.debug(f'{self} - already in live mode') - # silently ignore it for the current client but send EAGAIN to + # silently ignore it for the current client but send EBUSY to # other clients if sender != self._listening_client[0]: - status = GLib.Variant.new_int32(-errno.EAGAIN) + status = GLib.Variant.new_int32(-errno.EBUSY) self.signal('LiveStopped', status, dest=sender) return @@ -577,10 +577,10 @@ class TuhiDBusServer(_TuhiDBus): if self.is_searching: logger.debug('Already searching') - # silently ignore it for the current client but send EAGAIN to + # silently ignore it for the current client but send EBUSY to # other clients if sender != self._searching_client[0]: - status = GLib.Variant.new_int32(-errno.EAGAIN) + status = GLib.Variant.new_int32(-errno.EBUSY) self.signal('SearchStopped', status) return