336 |
|
|
337 |
flags = O_RDWR|O_EXEC; |
flags = O_RDWR|O_EXEC; |
338 |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
339 |
if (file == MACH_PORT_NULL && (errno == EACCES |
if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP |
340 |
|| errno == EROFS || errno == EISDIR)) |
|| errno == EROFS || errno == EISDIR)) |
341 |
{ |
{ |
342 |
flags = O_RDWR; |
flags = O_RDWR; |
343 |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
344 |
} |
} |
345 |
if (file == MACH_PORT_NULL && (errno == EACCES |
if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP |
346 |
|| errno == EROFS || errno == EISDIR)) |
|| errno == EROFS || errno == EISDIR)) |
347 |
{ |
{ |
348 |
flags = O_READ|O_EXEC; |
flags = O_READ|O_EXEC; |
349 |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
350 |
} |
} |
351 |
if (file == MACH_PORT_NULL && errno == EACCES) |
if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP |
352 |
|
|| errno == EISDIR)) |
353 |
{ |
{ |
354 |
flags = O_READ; |
flags = O_READ; |
355 |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
356 |
} |
} |
357 |
|
if (file == MACH_PORT_NULL && (errno == EACCES || errno == EOPNOTSUPP |
358 |
|
|| errno == EISDIR)) |
359 |
|
{ |
360 |
|
flags = 0; |
361 |
|
file = file_name_lookup_under (dirfile, name, flags | O_NOLINK, 0); |
362 |
|
} |
363 |
*np = 0; |
*np = 0; |
364 |
if (file == MACH_PORT_NULL) |
if (file == MACH_PORT_NULL) |
365 |
err = errno; |
err = errno; |