X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev%2Fudevadm-settle.c;h=78ac47ff41260886cc64cc3aa47be5acc4c358ce;hb=9921484458e0233e1aae868bfa8cc1481aa460a8;hp=c6093a4311d72f5f2692c0a380753cb08cd15f52;hpb=d59f11e1407ec6fa26e3a6f20b2d404af6978199;p=elogind.git diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c index c6093a431..78ac47ff4 100644 --- a/udev/udevadm-settle.c +++ b/udev/udevadm-settle.c @@ -1,19 +1,18 @@ /* - * Copyright (C) 2006 Kay Sievers + * Copyright (C) 2006-2008 Kay Sievers * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #include @@ -45,7 +44,7 @@ static void print_queue(struct udev *udev, const char *dir) printf("\n\nAfter the udevadm settle timeout, the events queue contains:\n\n"); list_for_each_entry(item, &files, node) { - char target[NAME_SIZE]; + char target[UTIL_NAME_SIZE]; size_t len; const char *filename = strrchr(item->name, '/'); @@ -68,8 +67,8 @@ static void print_queue(struct udev *udev, const char *dir) int udevadm_settle(struct udev *udev, int argc, char *argv[]) { - char queuename[PATH_SIZE]; - char filename[PATH_SIZE]; + char queuename[UTIL_PATH_SIZE]; + char filename[UTIL_PATH_SIZE]; unsigned long long seq_kernel; unsigned long long seq_udev; char seqnum[32]; @@ -108,8 +107,8 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) } } - strlcpy(queuename, udev_get_dev_path(udev), sizeof(queuename)); - strlcat(queuename, "/.udev/queue", sizeof(queuename)); + util_strlcpy(queuename, udev_get_dev_path(udev), sizeof(queuename)); + util_strlcat(queuename, "/.udev/queue", sizeof(queuename)); loop = timeout * LOOP_PER_SECOND; while (loop--) { @@ -130,8 +129,8 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) } /* read current udev seqnum */ - strlcpy(filename, udev_get_dev_path(udev), sizeof(filename)); - strlcat(filename, "/.udev/uevent_seqnum", sizeof(filename)); + util_strlcpy(filename, udev_get_dev_path(udev), sizeof(filename)); + util_strlcat(filename, "/.udev/uevent_seqnum", sizeof(filename)); fd = open(filename, O_RDONLY); if (fd < 0) goto exit; @@ -144,8 +143,8 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) info(udev, "udev seqnum = %llu\n", seq_udev); /* read current kernel seqnum */ - strlcpy(filename, udev_get_sys_path(udev), sizeof(filename)); - strlcat(filename, "/kernel/uevent_seqnum", sizeof(filename)); + util_strlcpy(filename, udev_get_sys_path(udev), sizeof(filename)); + util_strlcat(filename, "/kernel/uevent_seqnum", sizeof(filename)); fd = open(filename, O_RDONLY); if (fd < 0) goto exit;