
26 Jan
2010
26 Jan
'10
1:29 p.m.
According to Jim Meyering on 1/25/2010 8:55 AM:
Subject: [PATCH] hostusb: closedir only if non-NULL; rename labels: s/error/cleanup/
* src/util/hostusb.c (usbSysReadFile): Rename labels s/error/cleanup/ (usbFindBusByVendor): Likewise. And closedir only if non-NULL. @@ -150,8 +150,9 @@ static int usbFindBusByVendor(virConnectPtr conn, else ret = 0;
-error: - closedir (dir); +cleanup: + if (dir) + closedir (dir);
Should errno be saved and restored around this point, to avoid it being arbitrarily changed by closedir? -- Don't work too hard, make some time for fun as well! Eric Blake ebb9@byu.net