[prev in list] [next in list] [prev in thread] [next in thread]
List: ltp-cvs
Subject: [Ltp-cvs] ltp/testcases/kernel/syscalls/flock flock01.c, 1.1,
From: Subrata <subrata_modak () users ! sourceforge ! net>
Date: 2007-10-30 10:47:06
Message-ID: E1Imoco-0005nL-8X () mail ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv7504/ltp/testcases/kernel/syscalls/flock
Modified Files:
flock01.c flock02.c flock03.c flock04.c flock05.c flock06.c
Log Message:
Breno Leitao (leitao@linux.vnet.ibm.com) fixed these for running on NFS mounted systems
Index: flock05.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock/flock05.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** flock05.c 11 Jul 2005 22:28:18 -0000 1.4
--- flock05.c 30 Oct 2007 10:47:04 -0000 1.5
***************
*** 171,174 ****
--- 171,176 ----
}/* End of TEST_LOOPING */
+ close(fd);
+ close(fd1);
cleanup();
return 0;
Index: flock01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock/flock01.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** flock01.c 2 Dec 2002 18:23:30 -0000 1.1
--- flock01.c 30 Oct 2007 10:47:03 -0000 1.2
***************
*** 143,146 ****
--- 143,148 ----
}/* End of TEST_LOOPING */
+ close(fd);
+
cleanup();
Index: flock04.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock/flock04.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** flock04.c 11 Jul 2005 22:28:18 -0000 1.4
--- flock04.c 30 Oct 2007 10:47:04 -0000 1.5
***************
*** 171,174 ****
--- 171,176 ----
}
+ close(fd);
+ close(fd1);
}/* End of TEST_LOOPING */
Index: flock02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock/flock02.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** flock02.c 3 Mar 2003 15:47:33 -0000 1.3
--- flock02.c 30 Oct 2007 10:47:04 -0000 1.4
***************
*** 161,164 ****
--- 161,166 ----
}/* End of TEST_LOOPING */
+ close(fd);
+
cleanup();
Index: flock03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock/flock03.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** flock03.c 16 Feb 2006 04:36:30 -0000 1.6
--- flock03.c 30 Oct 2007 10:47:04 -0000 1.7
***************
*** 153,156 ****
--- 153,158 ----
else
tst_resm(TFAIL, "flock03 Failed");
+
+ close(fd);
}/* End of TEST_LOOPING */
***************
*** 193,196 ****
--- 195,199 ----
tst_resm(TPASS, "Child: flock after unlocking passed");
+ close(fd);
close(fd2);
***************
*** 236,239 ****
--- 239,243 ----
tst_exit();
}
+ close(fd);
}
Index: flock06.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/flock/flock06.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** flock06.c 3 Mar 2003 16:19:20 -0000 1.1
--- flock06.c 30 Oct 2007 10:47:04 -0000 1.2
***************
*** 98,141 ****
for (lc = 0; TEST_LOOPING(lc); lc++) {
! int fd1, fd2;
! /* reset Tst_count in case we are looping */
! Tst_count = 0;
! fd1 = open(filename, O_RDWR);
! if (fd1 == -1)
! tst_brkm(TFAIL, cleanup, "failed to open the"
! "file, errno %d", errno);
! TEST(flock(fd1, LOCK_EX | LOCK_NB));
! if (TEST_RETURN != 0)
! tst_resm(TFAIL, "First attempt to flock() failed, "
! "errno %d",TEST_ERRNO);
! else
! tst_resm(TPASS, "First attempt to flock() passed");
! fd2 = open(filename, O_RDWR);
! if (fd2 == -1)
! tst_brkm(TFAIL, cleanup, "failed to open the"
! "file, errno %d", errno);
! TEST(flock(fd2, LOCK_EX | LOCK_NB));
! if (TEST_RETURN == -1)
! tst_resm(TPASS, "Second attempt to flock() denied");
! else
! tst_resm(TFAIL, "Second attempt to flock() succeeded!");
! TEST(flock(fd1, LOCK_UN));
! if (TEST_RETURN == -1)
! tst_resm(TFAIL, "Failed to unlock fd1, errno %d",
! TEST_ERRNO);
! else
! tst_resm(TPASS, "Unlocked fd1");
! TEST(flock(fd2, LOCK_EX | LOCK_NB));
! if (TEST_RETURN == -1)
! tst_resm(TFAIL, "Third attempt to flock() denied!");
! else
! tst_resm(TPASS, "Third attempt to flock() succeeded");
}/* End of TEST_LOOPING */
--- 98,143 ----
for (lc = 0; TEST_LOOPING(lc); lc++) {
! int fd1, fd2;
! /* reset Tst_count in case we are looping */
! Tst_count = 0;
! fd1 = open(filename, O_RDWR);
! if (fd1 == -1)
! tst_brkm(TFAIL, cleanup, "failed to open the"
! "file, errno %d", errno);
! TEST(flock(fd1, LOCK_EX | LOCK_NB));
! if (TEST_RETURN != 0)
! tst_resm(TFAIL, "First attempt to flock() failed, "
! "errno %d",TEST_ERRNO);
! else
! tst_resm(TPASS, "First attempt to flock() passed");
! fd2 = open(filename, O_RDWR);
! if (fd2 == -1)
! tst_brkm(TFAIL, cleanup, "failed to open the"
! "file, errno %d", errno);
! TEST(flock(fd2, LOCK_EX | LOCK_NB));
! if (TEST_RETURN == -1)
! tst_resm(TPASS, "Second attempt to flock() denied");
! else
! tst_resm(TFAIL, "Second attempt to flock() succeeded!");
! TEST(flock(fd1, LOCK_UN));
! if (TEST_RETURN == -1)
! tst_resm(TFAIL, "Failed to unlock fd1, errno %d",
! TEST_ERRNO);
! else
! tst_resm(TPASS, "Unlocked fd1");
! TEST(flock(fd2, LOCK_EX | LOCK_NB));
! if (TEST_RETURN == -1)
! tst_resm(TFAIL, "Third attempt to flock() denied!");
! else
! tst_resm(TPASS, "Third attempt to flock() succeeded");
! close(fd1);
! close(fd2);
}/* End of TEST_LOOPING */
***************
*** 154,186 ****
void setup(void)
{
! int fd;
! /* capture signals */
! tst_sig(FORK, DEF_HANDLER, cleanup);
! /* Pause if that option was specified
! * TEST_PAUSE contains the code to fork the test with the -i option.
! * You want to make sure you do this before you create your temporary
! * directory.
! */
! TEST_PAUSE;
! /* Create a unique temporary directory and chdir() to it. */
! tst_tmpdir();
! sprintf(filename, "flock06.%d", getpid());
! /* creating temporary file */
! fd = creat(filename, 0666);
! if (fd < 0) {
! tst_resm(TFAIL, "creating a new file failed");
!
! TEST_CLEANUP;
! /* Removing temp dir */
! tst_rmdir();
! /* exit with return code appropriate for result */
! tst_exit();
! }
}
--- 156,189 ----
void setup(void)
{
! int fd;
! /* capture signals */
! tst_sig(FORK, DEF_HANDLER, cleanup);
! /* Pause if that option was specified
! * TEST_PAUSE contains the code to fork the test with the -i option.
! * You want to make sure you do this before you create your temporary
! * directory.
! */
! TEST_PAUSE;
! /* Create a unique temporary directory and chdir() to it. */
! tst_tmpdir();
! sprintf(filename, "flock06.%d", getpid());
! /* creating temporary file */
! fd = creat(filename, 0666);
! if (fd < 0) {
! tst_resm(TFAIL, "creating a new file failed");
!
! TEST_CLEANUP;
! /* Removing temp dir */
! tst_rmdir();
! /* exit with return code appropriate for result */
! tst_exit();
! }
! close(fd);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ltp-cvs mailing list
Ltp-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic