eventloop.c: apply patch from Jonas Bonn to retry read when failed with EINTR.
This can occur when libraw1394 caller receives a signal while in this read and the caller is not using a signal handler set with signal().
This commit is contained in:
parent
77b6ef1f9e
commit
a118281f85
|
@ -21,6 +21,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "raw1394.h"
|
#include "raw1394.h"
|
||||||
#include "kernel-raw1394.h"
|
#include "kernel-raw1394.h"
|
||||||
|
@ -32,8 +33,8 @@ int raw1394_loop_iterate(struct raw1394_handle *handle)
|
||||||
struct raw1394_request req;
|
struct raw1394_request req;
|
||||||
int retval = 0, channel;
|
int retval = 0, channel;
|
||||||
|
|
||||||
if (read(handle->fd, &req, sizeof(req)) < 0) {
|
while (read(handle->fd, &req, sizeof(req)) < 0) {
|
||||||
return -1;
|
if (errno != EINTR) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (req.type) {
|
switch (req.type) {
|
||||||
|
|
Reference in New Issue