Hi!
> cleanup of fpathconf01.c

Pushed both patches with following modifications:

 /*
- * Testcase to test the basic functionality of fpathconf(2) systemm call.
+ * Testcase to test the basic functionality of fpathconf(2) system call.
  */
                                                                ^
                                                           Fixed typo

 #include <fcntl.h>
@@ -83,13 +83,14 @@ int main(int ac, char **av)
                tst_count = 0;
 
                for (i = 0; i < TST_TOTAL; i++) {
+                       errno = 0;
                        ^
                        The fpathconf does not modify errno and returns -1 if
                        configuration option has no limit, therefore we must
                        set errno to zero ourselves.

                        TEST(fpathconf(fd, test_cases[i].value));
 
                        if (TEST_RETURN == -1) {
                                if (TEST_ERRNO == 0) {
                                        tst_resm(TINFO,
-                                                "fpathconf has NO the limit: "
+                                                "fpathconf has NO limit for "
                                                 "%s", test_cases[i].name);
                                } else {
                                        tst_resm(TFAIL | TTERRNO,
@@ -124,7 +125,8 @@ static void cleanup(void)
 {
        TEST_CLEANUP;
 
-       SAFE_CLOSE(NULL, fd);
+       if (fd > 0)
+               SAFE_CLOSE(NULL, fd);
        ^
        In unlikely case that the SAFE_OPEN() would fail you will close stdin 
here
        (because fd is global variable and initialized to zero).

        tst_rmdir();
 }


-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to