If a device node is given without path, and opening the node fails
initially, prepend "/dev/" to the node name and try opening again.
This is more in line with NetBSD behavior.
Change-Id: Ib544aec52abe43132510f0e4b173b00fb3dbaab8
int f;
#endif
+#ifdef __minix
+ /*
+ * MINIX does not have the cooked/raw distinction. Do not prepend 'r'
+ * to the device name when generating a full path.
+ */
+ iscooked = 1;
+#endif
+
if (buf == NULL) {
errno = EFAULT;
return (-1);
f = ofn(buf, flags, 0);
if (f != -1 || errno != ENOENT)
return (f);
+#endif
if (strchr(path, '/') != NULL)
return (-1);
if (f != -1 || errno != ENOENT)
return (f);
+#ifndef __minix
snprintf(buf, buflen, "%s%s%s%c", _PATH_DEV, iscooked ? "" : "r", path,
'a' + rawpart);
f = ofn(buf, flags, 0);