diff options
author | Dan Williams <dcbw@redhat.com> | 2010-04-24 23:44:35 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-04-24 23:44:35 -0700 |
commit | a4c094c340e0c93149a4e9042db4a88f9800467f (patch) | |
tree | d4e1d0ff8f64aa7df174868119fda3f0c0c4e761 /src | |
parent | b9bb12a01e0fd0251475622cf2adc3ca04ba7bd0 (diff) |
core: fix serial error #defines
Should have ERROR in them.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-errors.c | 10 | ||||
-rw-r--r-- | src/mm-errors.h | 8 | ||||
-rw-r--r-- | src/mm-plugin-base.c | 6 | ||||
-rw-r--r-- | src/mm-serial-port.c | 16 |
4 files changed, 20 insertions, 20 deletions
diff --git a/src/mm-errors.c b/src/mm-errors.c index f3c16331..aa900608 100644 --- a/src/mm-errors.c +++ b/src/mm-errors.c @@ -39,11 +39,11 @@ mm_serial_error_get_type (void) if (etype == 0) { static const GEnumValue values[] = { - ENUM_ENTRY (MM_SERIAL_OPEN_FAILED, "SerialOpenFailed"), - ENUM_ENTRY (MM_SERIAL_SEND_FAILED, "SerialSendfailed"), - ENUM_ENTRY (MM_SERIAL_RESPONSE_TIMEOUT, "SerialResponseTimeout"), - ENUM_ENTRY (MM_SERIAL_OPEN_FAILED_NO_DEVICE, "SerialOpenFailedNoDevice"), - ENUM_ENTRY (MM_SERIAL_ERROR_FLASH_FAILED, "SerialFlashFailed"), + ENUM_ENTRY (MM_SERIAL_ERROR_OPEN_FAILED, "SerialOpenFailed"), + ENUM_ENTRY (MM_SERIAL_ERROR_SEND_FAILED, "SerialSendfailed"), + ENUM_ENTRY (MM_SERIAL_ERROR_RESPONSE_TIMEOUT, "SerialResponseTimeout"), + ENUM_ENTRY (MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE, "SerialOpenFailedNoDevice"), + ENUM_ENTRY (MM_SERIAL_ERROR_FLASH_FAILED, "SerialFlashFailed"), { 0, 0, 0 } }; diff --git a/src/mm-errors.h b/src/mm-errors.h index 6da2993a..b6891c35 100644 --- a/src/mm-errors.h +++ b/src/mm-errors.h @@ -20,10 +20,10 @@ #include <glib-object.h> enum { - MM_SERIAL_OPEN_FAILED = 0, - MM_SERIAL_SEND_FAILED = 1, - MM_SERIAL_RESPONSE_TIMEOUT = 2, - MM_SERIAL_OPEN_FAILED_NO_DEVICE = 3, + MM_SERIAL_ERROR_OPEN_FAILED = 0, + MM_SERIAL_ERROR_SEND_FAILED = 1, + MM_SERIAL_ERROR_RESPONSE_TIMEOUT = 2, + MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE = 3, MM_SERIAL_ERROR_FLASH_FAILED = 4, }; diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c index ac8b0d5b..3e9a754e 100644 --- a/src/mm-plugin-base.c +++ b/src/mm-plugin-base.c @@ -574,7 +574,7 @@ real_handle_probe_response (MMPluginBase *self, ignore_error = TRUE; if (error && !ignore_error) { - if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_RESPONSE_TIMEOUT)) { + if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { /* Try GCAP again */ if (task_priv->probe_state < PROBE_STATE_GCAP_TRY3) { task_priv->probe_state++; @@ -734,7 +734,7 @@ custom_init_response (MMAtSerialPort *port, return; } else if (task_priv->custom_init_fail_if_timeout) { /* Fail the probe if the plugin wanted it and the command timed out */ - if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_RESPONSE_TIMEOUT)) { + if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) { probe_complete (task); return; } @@ -784,7 +784,7 @@ try_open (gpointer user_data) probe_complete (task); } else if (g_error_matches (error, MM_SERIAL_ERROR, - MM_SERIAL_OPEN_FAILED_NO_DEVICE)) { + MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE)) { /* this is nozomi being dumb; try again */ task_priv->open_id = g_timeout_add_seconds (1, try_open, task); } else { diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c index a10b3ea8..b7fdf275 100644 --- a/src/mm-serial-port.c +++ b/src/mm-serial-port.c @@ -362,13 +362,13 @@ mm_serial_port_send_command (MMSerialPort *self, const guint8 *p; if (priv->fd < 0) { - g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_SEND_FAILED, + g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_SEND_FAILED, "%s", "Sending command failed: device is not enabled"); return FALSE; } if (mm_port_get_connected (MM_PORT (self))) { - g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_SEND_FAILED, + g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_SEND_FAILED, "%s", "Sending command failed: device is connected"); return FALSE; } @@ -386,12 +386,12 @@ mm_serial_port_send_command (MMSerialPort *self, if (errno == EAGAIN) { eagain_count--; if (eagain_count <= 0) { - g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_SEND_FAILED, + g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_SEND_FAILED, "Sending command failed: '%s'", strerror (errno)); break; } } else { - g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_SEND_FAILED, + g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_SEND_FAILED, "Sending command failed: '%s'", strerror (errno)); break; } @@ -526,7 +526,7 @@ mm_serial_port_timed_out (gpointer data) priv->timeout_id = 0; error = g_error_new_literal (MM_SERIAL_ERROR, - MM_SERIAL_RESPONSE_TIMEOUT, + MM_SERIAL_ERROR_RESPONSE_TIMEOUT, "Serial command timed out"); /* FIXME: This is not completely correct - if the response finally arrives and there's some other command waiting for response right now, the other command will @@ -708,13 +708,13 @@ mm_serial_port_open (MMSerialPort *self, GError **error) */ g_set_error (error, MM_SERIAL_ERROR, - (errno == ENODEV) ? MM_SERIAL_OPEN_FAILED_NO_DEVICE : MM_SERIAL_OPEN_FAILED, + (errno == ENODEV) ? MM_SERIAL_ERROR_OPEN_FAILED_NO_DEVICE : MM_SERIAL_ERROR_OPEN_FAILED, "Could not open serial device %s: %s", device, strerror (errno)); return FALSE; } if (ioctl (priv->fd, TIOCEXCL) < 0) { - g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_OPEN_FAILED, + g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED, "Could not lock serial device %s: %s", device, strerror (errno)); close (priv->fd); priv->fd = -1; @@ -725,7 +725,7 @@ mm_serial_port_open (MMSerialPort *self, GError **error) tcflush (priv->fd, TCIOFLUSH); if (tcgetattr (priv->fd, &priv->old_t) < 0) { - g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_OPEN_FAILED, + g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED, "Could not open serial device %s: %s", device, strerror (errno)); close (priv->fd); priv->fd = -1; |