X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fproc.c;h=429cea6904db321b11be6dd5bee15fb4c85f4e66;hb=e5d1d2dbb64cafd33f9b012b7959b61319dcd250;hp=9b33863e69e68cfdbc42821c2d87b9fcbd647359;hpb=1579c198ae9ddbb92a9ebc29f76eec169397fdd4;p=pciutils.git diff --git a/lib/proc.c b/lib/proc.c index 9b33863..429cea6 100644 --- a/lib/proc.c +++ b/lib/proc.c @@ -1,9 +1,11 @@ /* * The PCI Library -- Configuration Access via /proc/bus/pci * - * Copyright (c) 1997--2003 Martin Mares + * Copyright (c) 1997--2023 Martin Mares * - * Can be freely distributed and used under the terms of the GNU GPL. + * Can be freely distributed and used under the terms of the GNU GPL v2+. + * + * SPDX-License-Identifier: GPL-2.0-or-later */ #define _GNU_SOURCE @@ -17,7 +19,6 @@ #include #include "internal.h" -#include "pread.h" static void proc_config(struct pci_access *a) @@ -160,7 +161,6 @@ proc_setup(struct pci_dev *d, int rw) if (a->fd < 0) a->warning("Cannot open %s", buf); a->cached_dev = d; - a->fd_pos = 0; } return a->fd; } @@ -173,7 +173,7 @@ proc_read(struct pci_dev *d, int pos, byte *buf, int len) if (fd < 0) return 0; - res = do_read(d, fd, buf, len, pos); + res = pread(fd, buf, len, pos); if (res < 0) { d->access->warning("proc_read: read failed: %s", strerror(errno)); @@ -192,7 +192,7 @@ proc_write(struct pci_dev *d, int pos, byte *buf, int len) if (fd < 0) return 0; - res = do_write(d, fd, buf, len, pos); + res = pwrite(fd, buf, len, pos); if (res < 0) { d->access->warning("proc_write: write failed: %s", strerror(errno));