mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 19:48:47 +00:00
trivial: Add FU_UDEV_DEVICE_FLAG_OPEN_SYNC for future code
This commit is contained in:
parent
0fb2ef3aae
commit
02222a58c8
@ -1248,6 +1248,10 @@ fu_udev_device_open(FuDevice *device, GError **error)
|
||||
#ifdef O_NONBLOCK
|
||||
if (priv->flags & FU_UDEV_DEVICE_FLAG_OPEN_NONBLOCK)
|
||||
flags |= O_NONBLOCK;
|
||||
#endif
|
||||
#ifdef O_SYNC
|
||||
if (priv->flags & FU_UDEV_DEVICE_FLAG_OPEN_SYNC)
|
||||
flags |= O_SYNC;
|
||||
#endif
|
||||
priv->fd = g_open(priv->device_file, flags, 0);
|
||||
if (priv->fd < 0) {
|
||||
|
@ -33,6 +33,7 @@ struct _FuUdevDeviceClass {
|
||||
* @FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT: Get the vendor ID fallback from the parent
|
||||
* @FU_UDEV_DEVICE_FLAG_USE_CONFIG: Read and write from the device config
|
||||
* @FU_UDEV_DEVICE_FLAG_OPEN_NONBLOCK: Open nonblocking, e.g. O_NONBLOCK
|
||||
* @FU_UDEV_DEVICE_FLAG_OPEN_SYNC: Open sync, e.g. O_SYNC
|
||||
*
|
||||
* Flags used when opening the device using fu_device_open().
|
||||
**/
|
||||
@ -43,6 +44,7 @@ typedef enum {
|
||||
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT = 1 << 2,
|
||||
FU_UDEV_DEVICE_FLAG_USE_CONFIG = 1 << 3,
|
||||
FU_UDEV_DEVICE_FLAG_OPEN_NONBLOCK = 1 << 4,
|
||||
FU_UDEV_DEVICE_FLAG_OPEN_SYNC = 1 << 5,
|
||||
/*< private >*/
|
||||
FU_UDEV_DEVICE_FLAG_LAST
|
||||
} FuUdevDeviceFlags;
|
||||
|
Loading…
Reference in New Issue
Block a user