On 05/23/11 15:42, Christoph Hellwig wrote:
+    if (lstat(filename,&sb)<  0) {
+        fprintf(stderr, "%s: stat failed: %s\n", filename,
strerror(errno));
+        return -errno;
+    }
+
+    if (S_ISBLK(sb.st_mode))
+        filename = raw_get_rawdevice(filename);

Please move the lstat and S_ISBLK check into raw_get_rawdevice.

Why? What raw_get_rawdevice() does is only relevant to block devices
and this hunk makes that clear.

Christoph

> Also it might be worth to rename it to something like raw_normalize_devicepath.


--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632


Reply via email to