chiark / gitweb /
udev: usb_id: parse only 'size' bytes of the 'descriptors' buffer
[elogind.git] / src / udev / udev-ctrl.c
index dd345f80a257f91ac6aa6f6ded751649d06b5f0b..6ee6b04b1b39ee3acae55a46f195518fb1963620 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libudev - interface to udev device information
  *
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008 Kay Sievers <kay@vrfy.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -93,8 +93,7 @@ struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd)
         }
 
         uctrl->saddr.sun_family = AF_LOCAL;
-        util_strscpyl(uctrl->saddr.sun_path, sizeof(uctrl->saddr.sun_path),
-                      udev_get_run_path(udev), "/control", NULL);
+        strscpy(uctrl->saddr.sun_path, sizeof(uctrl->saddr.sun_path), "/run/udev/control");
         uctrl->addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(uctrl->saddr.sun_path);
         return uctrl;
 }
@@ -251,7 +250,7 @@ static int ctrl_send(struct udev_ctrl *uctrl, enum udev_ctrl_msg_type type, int
         ctrl_msg_wire.type = type;
 
         if (buf != NULL)
-                util_strscpy(ctrl_msg_wire.buf, sizeof(ctrl_msg_wire.buf), buf);
+                strscpy(ctrl_msg_wire.buf, sizeof(ctrl_msg_wire.buf), buf);
         else
                 ctrl_msg_wire.intval = intval;
 
@@ -337,7 +336,6 @@ int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout)
 
 struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn)
 {
-        struct udev *udev = conn->uctrl->udev;
         struct udev_ctrl_msg *uctrl_msg;
         ssize_t size;
         struct msghdr smsg;