Ensure that the fd is marked invalid after close. Also, the "closed"
and "reopen" variables are always set to 0. Remove them.
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
static int server = 1;
static int maxio = 8192;
static int port = 7890;
-static int reopen=0;
-static int closed=0;
static int testnumber = -1;
static int saved_errno = 0;
{
if ((f_fd = OPEN(filename, flag)) == INVALID_HANDLE) {
perror("shared file create");
- closed = 0;
return FAIL;
/*NOTREACHED*/
}
- closed = 0;
-
#ifdef __sun
if (D_flag) {
directio(f_fd, DIRECTIO_ON);
errno =0;
CLOSE(f_fd);
+ f_fd = INVALID_HANDLE;
saved_errno = errno;
if (errno)
return FAIL;
- return(PASS);
+ return PASS;
}
void
void
cleanup(void)
{
- if (f_fd>=0 && !reopen && !closed)
+ if (f_fd>=0)
CLOSE(f_fd);
if (c_fd>=0)