From: Robert W. <ro...@us...> - 2006-01-13 22:29:38
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/fcntl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29935 Modified Files: fcntl27.c Log Message: Applied patch from Jacky Malcles: during its life fcntl23 has changed: used to open the file with O_RDWR and now is opening with O_RDONLY (to avoid a TestCase duplicate) I suggest a change to fcntl27 which was opening the file with O_RDONLY to open now with O_RDWR Index: fcntl27.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fcntl/fcntl27.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fcntl27.c 31 Aug 2005 20:27:14 -0000 1.2 --- fcntl27.c 13 Jan 2006 22:29:27 -0000 1.3 *************** *** 106,110 **** extern int Tst_count; /* Test Case counter for tst_* routines */ ! int exp_enos[]={0, 0}; char fname[255]; --- 106,110 ---- extern int Tst_count; /* Test Case counter for tst_* routines */ ! int exp_enos[]={EAGAIN, 0}; char fname[255]; *************** *** 148,171 **** if ( TEST_RETURN == -1 ) { TEST_ERROR_LOG(TEST_ERRNO); ! tst_resm(TFAIL, "fcntl(%s, F_SETLEASE,F_RDLCK) Failed, errno=%d : %s", fname, ! TEST_ERRNO, strerror(TEST_ERRNO)); ! } else { ! ! /*************************************************************** ! * only perform functional verification if flag set (-f not given) ! ***************************************************************/ ! if ( STD_FUNCTIONAL_TEST ) { ! TEST(fcntl(fd, F_GETLEASE)); ! if ( TEST_RETURN != F_RDLCK ) ! tst_resm(TFAIL, "fcntl(%s, F_GETLEASE) did not return F_RDLCK, returned %d",fname, TEST_RETURN); ! else{ ! TEST(fcntl(fd, F_SETLEASE, F_UNLCK)); ! if ( TEST_RETURN != 0 ) ! tst_resm(TFAIL, "fcntl(%s, F_SETLEASE, F_UNLCK) did not return 0, returned %d",fname, TEST_RETURN); ! else ! tst_resm(TPASS, "fcntl(%s, F_SETLEASE,F_RDLCK)", fname); ! } ! } ! } #endif } /* End for TEST_LOOPING */ --- 148,167 ---- if ( TEST_RETURN == -1 ) { TEST_ERROR_LOG(TEST_ERRNO); ! if (TEST_ERRNO != exp_enos[0]) { ! tst_resm(TFAIL, ! "fcntl(%s, F_SETLEASE,F_RDLCK)" ! " Failed, errno=%d : %s", ! fname, TEST_ERRNO, strerror(TEST_ERRNO)); ! } else { ! tst_resm(TPASS, ! "expected failure - errno " ! "= %d : %s", ! TEST_ERRNO, strerror(TEST_ERRNO)); ! } ! } else { ! tst_resm(TFAIL, "fcntl(%s, F_SETLEASE, F_RDLCK)" ! " did not return -1, returned %d", ! fname, TEST_RETURN); ! } #endif } /* End for TEST_LOOPING */ *************** *** 195,201 **** sprintf(fname,"tfile_%d",getpid()); ! if ((fd = open(fname,O_RDONLY|O_CREAT,0777)) == -1) { tst_brkm(TBROK, cleanup, ! "open(%s, O_RDONLY|O_CREAT,0777) Failed, errno=%d : %s", fname, errno, strerror(errno)); } --- 191,197 ---- sprintf(fname,"tfile_%d",getpid()); ! if ((fd = open(fname,O_RDWR|O_CREAT,0777)) == -1) { tst_brkm(TBROK, cleanup, ! "open(%s, O_RDWR|O_CREAT,0777) Failed, errno=%d : %s", fname, errno, strerror(errno)); } |