/* Test 4 -> Checks open on an existent
 * file
**/

#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>

int main()
{
   int fd1 = -1;
   int err;

   fd1 = open("file5", O_RDONLY);
   printf("open return: %d\n", fd1);
   fflush(stdout);
   if(fd1 == -1) {
         return -1;
   }
 
   err = close(fd1);
   printf("close returned: %d\n", err);
   if(err == -1)
        return -1;

   return 0;  
}
