Use the SELECT_* enum for a few more uxsel flags.

This cleans up some spots that were missed in 47202c4e16.
This commit is contained in:
Colin Watson 2019-03-20 10:50:44 +00:00 коммит произвёл Simon Tatham
Родитель 867e691874
Коммит 6ce6fe5712
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -107,18 +107,18 @@ uxsel_id *uxsel_input_add(int fd, int rwx) {
#if GTK_CHECK_VERSION(2,0,0)
int flags = 0;
if (rwx & 1) flags |= G_IO_IN | G_IO_HUP;
if (rwx & 2) flags |= G_IO_OUT;
if (rwx & 4) flags |= G_IO_PRI;
if (rwx & SELECT_R) flags |= G_IO_IN | G_IO_HUP;
if (rwx & SELECT_W) flags |= G_IO_OUT;
if (rwx & SELECT_X) flags |= G_IO_PRI;
id->chan = g_io_channel_unix_new(fd);
g_io_channel_set_encoding(id->chan, NULL, NULL);
id->watch_id = g_io_add_watch_full(id->chan, GDK_PRIORITY_REDRAW+1, flags,
fd_input_func, NULL, NULL);
#else
int flags = 0;
if (rwx & 1) flags |= GDK_INPUT_READ;
if (rwx & 2) flags |= GDK_INPUT_WRITE;
if (rwx & 4) flags |= GDK_INPUT_EXCEPTION;
if (rwx & SELECT_R) flags |= GDK_INPUT_READ;
if (rwx & SELECT_W) flags |= GDK_INPUT_WRITE;
if (rwx & SELECT_X) flags |= GDK_INPUT_EXCEPTION;
assert(flags);
id->id = gdk_input_add(fd, flags, fd_input_func, NULL);
#endif

Просмотреть файл

@ -417,9 +417,9 @@ static void serial_uxsel_setup(Serial *serial)
int rwx = 0;
if (serial->inbufsize <= SERIAL_MAX_BACKLOG)
rwx |= 1;
rwx |= SELECT_R;
if (bufchain_size(&serial->output_data))
rwx |= 2; /* might also want to write to it */
rwx |= SELECT_W; /* might also want to write to it */
uxsel_set(serial->fd, rwx, serial_select_result);
}