[systemd-commits] 2 commits - src/bootchart src/udev
Kay Sievers
kay at kemper.freedesktop.org
Wed Jan 9 08:15:43 PST 2013
src/bootchart/log.c | 2 +-
src/udev/udev-builtin-net_id.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 0908dd2fd5536cf15d75780980ac2eca37ff800f
Author: Lukas Nykryn <lnykryn at redhat.com>
Date: Wed Jan 9 17:10:57 2013 +0100
bootchart: check return of fopen before setvbuf in log.c
diff --git a/src/bootchart/log.c b/src/bootchart/log.c
index 89c7b35..6c40913 100644
--- a/src/bootchart/log.c
+++ b/src/bootchart/log.c
@@ -364,9 +364,9 @@ schedstat_next:
if (!ps->smaps) {
sprintf(filename, "/proc/%d/smaps", pid);
ps->smaps = fopen(filename, "r");
- setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
if (!ps->smaps)
continue;
+ setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
} else {
rewind(ps->smaps);
}
commit 3c123e0899b56c0587db36420da5e049c56d9e19
Author: Lukas Nykryn <lnykryn at redhat.com>
Date: Wed Jan 9 17:10:56 2013 +0100
udev: don't call fclose on NULL in is_pci_multifunction
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 1975c6d..7c9564f 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -136,7 +136,7 @@ static int dev_pci_onboard(struct udev_device *dev, struct netnames *names) {
/* read the 256 bytes PCI configuration space to check the multi-function bit */
static bool is_pci_multifunction(struct udev_device *dev) {
char filename[256];
- FILE *f;
+ FILE *f = NULL;
char config[64];
bool multi = false;
@@ -151,7 +151,8 @@ static bool is_pci_multifunction(struct udev_device *dev) {
if ((config[PCI_HEADER_TYPE] & 0x80) != 0)
multi = true;
out:
- fclose(f);
+ if(f)
+ fclose(f);
return multi;
}
More information about the systemd-commits
mailing list