summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-06 23:41:24 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-07-06 23:41:24 -0700
commit4ce670e249666dc5fb92357a157cf84071617f42 (patch)
treef8b58c5541bfb4485f90a16c2b09ae1d00d0e1de
parenta24758ca0b7d2157787b620e322d52714367b27a (diff)
downloadconnman-4ce670e249666dc5fb92357a157cf84071617f42.tar.gz
connman-4ce670e249666dc5fb92357a157cf84071617f42.tar.bz2
connman-4ce670e249666dc5fb92357a157cf84071617f42.zip
Fix various error definitions
-rw-r--r--src/connman.h1
-rw-r--r--src/error.c17
2 files changed, 16 insertions, 2 deletions
diff --git a/src/connman.h b/src/connman.h
index 50e5d664..380bfe37 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -40,6 +40,7 @@ DBusMessage *__connman_error_not_implemented(DBusMessage *msg);
DBusMessage *__connman_error_no_carrier(DBusMessage *msg);
DBusMessage *__connman_error_in_progress(DBusMessage *msg);
DBusMessage *__connman_error_already_connected(DBusMessage *msg);
+DBusMessage *__connman_error_not_connected(DBusMessage *msg);
DBusMessage *__connman_error_operation_aborted(DBusMessage *msg);
DBusMessage *__connman_error_operation_timeout(DBusMessage *msg);
DBusMessage *__connman_error_invalid_service(DBusMessage *msg);
diff --git a/src/error.c b/src/error.c
index 7c427176..1cebaa93 100644
--- a/src/error.c
+++ b/src/error.c
@@ -39,9 +39,17 @@ DBusMessage *__connman_error_failed(DBusMessage *msg, int errnum)
return __connman_error_permission_denied(msg);
case EINVAL:
return __connman_error_invalid_arguments(msg);
- case EALREADY:
+ case ENOSYS:
+ return __connman_error_not_implemented(msg);
+ case ENOLINK:
+ return __connman_error_no_carrier(msg);
+ case EOPNOTSUPP:
+ return __connman_error_not_supported(msg);
+ case EISCONN:
return __connman_error_already_connected(msg);
- case EINPROGRESS:
+ case ENOTCONN:
+ return __connman_error_not_connected(msg);
+ case EALREADY:
return __connman_error_in_progress(msg);
}
@@ -92,6 +100,11 @@ DBusMessage *__connman_error_already_connected(DBusMessage *msg)
}
+DBusMessage *__connman_error_not_connected(DBusMessage *msg)
+{
+ return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE
+ ".NotConnected", "Not connected");
+}
DBusMessage *__connman_error_operation_aborted(DBusMessage *msg)
{
return g_dbus_create_error(msg, CONNMAN_ERROR_INTERFACE