aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kkbd.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-08 19:15:24 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-08 19:15:24 +0100
commite9880491796516b7e2f835a3df6f20e5da06ebf7 (patch)
treedc10120bd50d39aa092bea82c1143e5df845ee04 /src/mds-kkbd.c
parentreplace all variants of goto pfail with fail_if (diff)
downloadmds-e9880491796516b7e2f835a3df6f20e5da06ebf7.tar.gz
mds-e9880491796516b7e2f835a3df6f20e5da06ebf7.tar.bz2
mds-e9880491796516b7e2f835a3df6f20e5da06ebf7.tar.xz
no more goto fail
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kkbd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mds-kkbd.c b/src/mds-kkbd.c
index 32ae6db..82b3d22 100644
--- a/src/mds-kkbd.c
+++ b/src/mds-kkbd.c
@@ -437,7 +437,7 @@ int master_loop(void)
if (r == -2)
{
eprint("corrupt message received, aborting.");
- goto fail;
+ goto done;
}
else if (errno == EINTR)
continue;
@@ -448,18 +448,17 @@ int master_loop(void)
mds_message_destroy(&received);
mds_message_initialise(&received);
connected = 0;
- if (reconnect_to_display())
- goto fail;
+ fail_if (reconnect_to_display());
connected = 1;
}
joined = 1;
fail_if ((errno = pthread_join(kbd_thread, &kbd_ret)));
rc = kbd_ret == NULL ? 0 : 1;
- goto fail;
+ goto done;
pfail:
xperror(*argv);
- fail:
+ done:
pthread_mutex_destroy(&send_mutex);
pthread_mutex_destroy(&mapping_mutex);
free(send_buffer);