--- Revision 343337616435 +++ Revision 333238386631 @@ -21,7 +21,8 @@ * O_DIRECTORY. Opening with O_RDONLY, without O_DIRECTORY succeeds for both * regular files and directories. */ - fd = open(argv[1], O_WRONLY); + fd = open(argv[1], O_WRONLY | O_DIRECTORY); + /* fd = open(argv[1], O_RDONLY); */ if (fd == -1) { printf("open error %d: %s\n", errno, strerror(errno)); } else {