random: Fix behavior of kernel option "-rs".
[pintos-anon] / src / tests / userprog / close-twice.c
1 /* Opens a file and then tries to close it twice.  The second
2    close must either fail silently or terminate with exit code
3    -1. */
4
5 #include <syscall.h>
6 #include "tests/lib.h"
7 #include "tests/main.h"
8
9 void
10 test_main (void) 
11 {
12   int handle;
13   CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\"");
14   msg ("close \"sample.txt\"");
15   close (handle);
16   msg ("close \"sample.txt\" again");
17   close (handle);
18 }