diff options
| author | Keith Packard <keithp@keithp.com> | 2009-07-18 00:43:22 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-07-18 00:43:22 -0700 |
| commit | 1e5e98bd8f5ea0bc15592de454e3629383462371 (patch) | |
| tree | f9a3088baebc0f2d3f5f0654dc4e8a526d0744c1 /aoview/aoview_serial.c | |
| parent | 08f37056deec25d77062bc411a04033401b033a5 (diff) | |
Trim aoview_serial_set_callback args down to just port and callback
Diffstat (limited to 'aoview/aoview_serial.c')
| -rw-r--r-- | aoview/aoview_serial.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/aoview/aoview_serial.c b/aoview/aoview_serial.c index 1d8fefce..f5142ea5 100644 --- a/aoview/aoview_serial.c +++ b/aoview/aoview_serial.c @@ -250,6 +250,7 @@ aoview_serial_open(const char *tty) serial->poll_fd.events = G_IO_IN | G_IO_OUT | G_IO_HUP | G_IO_ERR; g_source_attach(&serial->source, NULL); g_source_add_poll(&serial->source,&serial->poll_fd); + aoview_serial_set_callback(serial, NULL); return serial; } @@ -257,16 +258,13 @@ void aoview_serial_close(struct aoview_serial *serial) { g_source_remove_poll(&serial->source, &serial->poll_fd); + close(serial->fd); g_source_destroy(&serial->source); - g_source_unref(&serial->source); - free(serial); } void aoview_serial_set_callback(struct aoview_serial *serial, - aoview_serial_callback func, - gpointer data, - GDestroyNotify notify) + aoview_serial_callback func) { - g_source_set_callback(&serial->source, (GSourceFunc) func, data, notify); + g_source_set_callback(&serial->source, (GSourceFunc) func, serial, NULL); } |
