00001 /* Opens a file and then tries to close it twice. The second 00002 close must either fail silently or terminate with exit code 00003 -1. */ 00004 00005 #include <syscall.h> 00006 #include "tests/lib.h" 00007 #include "tests/main.h" 00008 00009 void 00010 test_main (void) 00011 { 00012 int handle; 00013 CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\""); 00014 msg ("close \"sample.txt\""); 00015 close (handle); 00016 msg ("close \"sample.txt\" again"); 00017 close (handle); 00018 }