X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fat-func2.c;h=b4d6067a57b8e9c9dc37999410dbed6c433fa1d6;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=a19b60b72f5940e12ab2d75696eb728879c13414;hpb=c4194dcc56767f8f96bc005088b292f519b13910;p=gnulib.git diff --git a/lib/at-func2.c b/lib/at-func2.c index a19b60b72..b4d6067a5 100644 --- a/lib/at-func2.c +++ b/lib/at-func2.c @@ -1,5 +1,5 @@ -/* Define an at-style functions like linkat or renameat. - Copyright (C) 2006, 2009 Free Software Foundation, Inc. +/* Define 2-FD at-style functions like linkat or renameat. + Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc. 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 @@ -25,7 +25,7 @@ #include #include -#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ #include "filenamecat.h" #include "openat.h" #include "same-inode.h" @@ -110,7 +110,7 @@ at_func2 (int fd1, char const *file1, } } else if (proc_file1 != proc_buf1 && proc_file1 != file1) - free (proc_buf1); + free (proc_file1); } } @@ -132,7 +132,7 @@ at_func2 (int fd1, char const *file1, errno = ENOTDIR; return -1; } - if (SAME_INODE (st1, st2) == 1) /* Reduced to cases 1, 5. */ + if (SAME_INODE (st1, st2)) /* Reduced to cases 1, 5. */ return func (file1, file2); } else if (fd2 == AT_FDCWD) /* Cases 12, 13. */ @@ -144,7 +144,7 @@ at_func2 (int fd1, char const *file1, errno = ENOTDIR; return -1; } - if (SAME_INODE (st1, st2) == 1) /* Reduced to cases 4, 5. */ + if (SAME_INODE (st1, st2)) /* Reduced to cases 4, 5. */ return func (file1, file2); } else if (fd1 != fd2) /* Case 15b. */ @@ -156,10 +156,10 @@ at_func2 (int fd1, char const *file1, errno = ENOTDIR; return -1; } - if (SAME_INODE (st1, st2) == 1) /* Reduced to case 15a. */ + if (SAME_INODE (st1, st2)) /* Reduced to case 15a. */ { fd2 = fd1; - if (stat (".", &st1) == 0 && SAME_INODE (st1, st2) == 1) + if (stat (".", &st1) == 0 && SAME_INODE (st1, st2)) return func (file1, file2); /* Further reduced to case 5. */ } } @@ -172,7 +172,7 @@ at_func2 (int fd1, char const *file1, errno = ENOTDIR; return -1; } - if (stat (".", &st2) == 0 && SAME_INODE (st1, st2) == 1) + if (stat (".", &st2) == 0 && SAME_INODE (st1, st2)) return func (file1, file2); /* Reduced to case 5. */ }