X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev.h;h=904948d67ac92d7df4fa80e27ae7eea6e44fb64d;hp=1f6e981cc2d627841661737d95f660664cc0ec88;hb=db7a38df63130fedcb937961886eff1c93c98139;hpb=d41120879358f783eb1a457f340c1a4b538a9410 diff --git a/udev.h b/udev.h index 1f6e981cc..904948d67 100644 --- a/udev.h +++ b/udev.h @@ -60,13 +60,6 @@ extern int log_message (int level, const char *format, ...) #define OWNER_SIZE 30 #define GROUP_SIZE 30 -struct device_attr { - char name[NAME_SIZE]; - char owner[OWNER_SIZE]; - char group[GROUP_SIZE]; - mode_t mode; -}; - struct udevice { char name[NAME_SIZE]; char owner[OWNER_SIZE]; @@ -77,6 +70,12 @@ struct udevice { mode_t mode; }; +#define strfieldcpy(to, from) \ +do { \ + to[sizeof(to)-1] = '\0'; \ + strncpy(to, from, sizeof(to)-1); \ +} while (0) + extern int udev_add_device(char *path, char *subsystem); extern int udev_remove_device(char *path, char *subsystem);