vlc/modules/control/dbus
Alexandre Janniaux 2f2a478740 control: dbus: check EINTR for read
The definition of read() mandates from its prototype that the return
value and errno must be checked since the syscall can be interrupted
without being processed by a signal:

    ../../modules/control/dbus/dbus.c: In function ‘Run’:
    ../../modules/control/dbus/dbus.c:958:19: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
      958 |             (void)read( fds[0].fd, &buf, 1 );
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~

In practice, the read is not done on a slow device, but a UNIX pipe
instead, and only when poll() notify that a read operation will be
non-blocking, and we're not supposed to have a signal handler here in
the normal execution (not using tools making use of SIGPROF for
instance), so read() being interrupted is nearly impossible, as opposed
to poll() being interrupted.

The read() call is also changed to use an anonymous compound litteral
which doesn't need to be marked as used manually, since we didn't use
the buffer variable at all.

In the future, using eventfd() to generate a semaphore compatible with
poll() and making the event handling lock-free might be a better
alternative, since read() will return the number of new events, and the
lock would become redundant.
2023-08-10 15:46:34 +00:00
..
dbus.c control: dbus: check EINTR for read 2023-08-10 15:46:34 +00:00
dbus_common.h modules: include vlc_arrays.h when using vlc_array_t 2023-05-04 10:00:11 +00:00
dbus_introspect.h dbus: Correct introspection data 2019-04-30 10:26:48 +02:00
dbus_player.c DBus control: do not query index of item if known 2023-01-05 22:44:44 +00:00
dbus_player.h modules: include vlc_arrays.h when using vlc_dictionary_t 2023-05-04 10:00:11 +00:00
dbus_root.c dbus: fix MPRIS MediaPlayer2 interface properties 2019-04-10 14:11:52 +02:00
dbus_root.h modules: include vlc_arrays.h when using vlc_dictionary_t 2023-05-04 10:00:11 +00:00
dbus_tracklist.c dbus: dbus: refactor release of events 2023-07-11 09:05:08 +00:00
dbus_tracklist.h dbus: dbus_tracklist: add missing inline qualifier 2023-07-11 09:05:08 +00:00