Skip to content

Commit f062088

Browse files
Streamline error reporting in suinput_enable_event().
All functions now return -1 if something went wrong (and errno is set accordingly) or a positive integer if everything went well.
1 parent c5b411e commit f062088

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/suinput.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ int suinput_enable_event(int uinput_fd, uint16_t ev_type, uint16_t ev_code)
166166
io = UI_SET_FFBIT;
167167
break;
168168
default:
169-
return -2;
169+
errno = EINVAL;
170+
return -1;
170171
}
171172

172173
return ioctl(uinput_fd, io, ev_code);

0 commit comments

Comments
 (0)