chiark / gitweb /
[PATCH] fix udev.spec to find udevinfo now that it has moved to /usr/bin
[elogind.git] / udevsend.c
index b5850294aef18aa1cf7fa42fe5456c783bd9d25f..4b6ef5c2f3b7f8929678d85ecd6524cf07113765 100644 (file)
@@ -52,39 +52,15 @@ void log_message (int level, const char *format, ...)
 }
 #endif
 
-static inline char *get_action(void)
-{
-       char *action;
-
-       action = getenv("ACTION");
-       return action;
-}
-
-static inline char *get_devpath(void)
-{
-       char *devpath;
-
-       devpath = getenv("DEVPATH");
-       return devpath;
-}
-
-static inline char *get_seqnum(void)
-{
-       char *seqnum;
-
-       seqnum = getenv("SEQNUM");
-       return seqnum;
-}
-
 static int build_hotplugmsg(struct hotplug_msg *msg, char *action,
                            char *devpath, char *subsystem, int seqnum)
 {
        memset(msg, 0x00, sizeof(*msg));
        strfieldcpy(msg->magic, UDEV_MAGIC);
        msg->seqnum = seqnum;
-       strncpy(msg->action, action, 8);
-       strncpy(msg->devpath, devpath, 128);
-       strncpy(msg->subsystem, subsystem, 16);
+       strfieldcpy(msg->action, action);
+       strfieldcpy(msg->devpath, devpath);
+       strfieldcpy(msg->subsystem, subsystem);
        return sizeof(struct hotplug_msg);
 }
 
@@ -144,7 +120,7 @@ int main(int argc, char* argv[])
 #endif
        dbg("version %s", UDEV_VERSION);
 
-       subsystem = argv[1];
+       subsystem = get_subsystem(argv[1]);
        if (subsystem == NULL) {
                dbg("no subsystem");
                goto exit;