From: Jiri P. <jpa...@we...> - 2009-10-04 22:17:33
|
Hello, On Wednesday 30 September 2009 04:06:46 Henry Yei wrote: > This patch for openfile contains the following changes: > - test output to use tst_resm functions > - sets ups and cleans up tmp dir properly > - closes all opened file descriptors before thread exit(fixes nfs issues on removing tmp dir) > > Signed-off-by: Henry Yei <hy...@mv...> > > > This test opens multiple file descriptors to the same file. Perhaps the author meant to open file handles for separate files? This is suspicious, for me too. But maybe there is some logic behind opening the same file many times. I just have a small remark about your patch: Shouldn't you call close_files() here, too? (With a partially full fd_list array handled, of course) +void * threads(void* thread_id_) { + int thread_id = (uintptr_t) thread_id_; + char errmsg[80]; + FILE *fd_list[MAXFILES]; + int i; + + /* Open files */ + for (i = 0; i < numfiles; i++) { + if (debug) + printf("Thread %d : Opening file number %d \n", thread_id, i); + if ((fd_list[i] = fopen(filename, "rw")) == NULL) { + sprintf(errmsg, "FAIL - Couldn't open file #%d", i); + perror(errmsg); Regards Jiri Palecek |