Hi!
> Add renameat.h to encapsulate renameat syscall.
> Delete some useless comments.
> Use some SAFE_* macros.
> Move the test body from main() to renameat_verify().

Pushed with folling changes, thanks.
(because it's important to check not only the errno but the return value
 as well)

 /*
  * Copyright (c) International Business Machines  Corp., 2006
+ *  Author: Yi Yang <yyang...@cn.ibm.com>
  *
  * This program is free software;  you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -150,6 +151,16 @@ static void renameat_verify(const struct test_case_t *tc)
        TEST(renameat(*(tc->oldfdptr), tc->oldpath,
                        *(tc->newfdptr), tc->newpath));
 
+       if (tc->exp_errno && TEST_RETURN != -1) {
+               tst_resm(TFAIL, "renameat() succeeded unexpectedly");
+               return;
+       }
+
+       if (tc->exp_errno == 0 && TEST_RETURN != 0) {
+               tst_resm(TFAIL | TTERRNO, "renameat() failed unexpectedly");
+               return;
+       }
+
        if (TEST_ERRNO == tc->exp_errno) {
                tst_resm(TPASS | TTERRNO,
                "renameat() returned the expected value");

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to