Changeset 3353


Ignore:
Timestamp:
May 7, 2007, 4:58:50 AM (18 years ago)
Author:
bird
Message:

rmdir doesn't resolve the last path component. Fixes #163.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/src/lib/sys/b_fsDirRemove.c

    r2254 r3353  
    22/** @file
    33 *
    4  * LIBC SYS Backend - rmdir.
     4 * kNIX - rmdir.
    55 *
    6  * Copyright (c) 2004 knut st. osmundsen <bird@innotek.de>
     6 * Copyright (c) 2004 knut st. osmundsen <bird-src-spam@anduin.net>
    77 *
    88 *
    9  * This file is part of InnoTek LIBC.
     9 * This file is part of kLIBC.
    1010 *
    11  * InnoTek LIBC is free software; you can redistribute it and/or modify
     11 * kLIBC is free software; you can redistribute it and/or modify
    1212 * it under the terms of the GNU Lesser General Public License as published
    1313 * by the Free Software Foundation; either version 2 of the License, or
    1414 * (at your option) any later version.
    1515 *
    16  * InnoTek LIBC is distributed in the hope that it will be useful,
     16 * kLIBC is distributed in the hope that it will be useful,
    1717 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1818 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     
    2020 *
    2121 * You should have received a copy of the GNU Lesser General Public License
    22  * along with InnoTek LIBC; if not, write to the Free Software
     22 * along with kLIBC; if not, write to the Free Software
    2323 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2424 *
     
    5858     */
    5959    char szNativePath[PATH_MAX];
    60     int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL_SYMLINK | BACKFS_FLAGS_RESOLVE_DIR, &szNativePath[0], NULL);
     60    int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_PARENT | BACKFS_FLAGS_RESOLVE_DIR, &szNativePath[0], NULL);
    6161    if (rc)
    6262        LIBCLOG_RETURN_INT(rc);
     
    7373
    7474    /*
    75      * OS/2 returns access denied when the directory
    76      * contains files or it is not a directory. Check for
    77      * directory/other and return failure accordingly.
     75     * - OS/2 returns access denied when the directory contains files
     76     *   or it is not a directory.
     77     * - OS/2 returns path not found when the directory is actually a file.
     78     *
     79     * So, check for directory/other and return failure accordingly.
    7880     */
    79     if (rc == ERROR_ACCESS_DENIED)
     81    if (    rc == ERROR_ACCESS_DENIED
     82        ||  rc == ERROR_PATH_NOT_FOUND)
    8083    {
    8184        struct stat s;
  • trunk/libc/src/kNIX/b_fsDirRemove.c

    r2929 r3353  
    4444     */
    4545    char szNativePath[PATH_MAX];
    46     int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_FULL_SYMLINK | BACKFS_FLAGS_RESOLVE_DIR, &szNativePath[0], NULL);
     46    int rc = __libc_back_fsResolve(pszPath, BACKFS_FLAGS_RESOLVE_PARENT | BACKFS_FLAGS_RESOLVE_DIR, &szNativePath[0], NULL);
    4747    if (!rc)
    4848        rc = __libc_back_fsNativeDirRemove(szNativePath);
  • trunk/libc/src/kNIX/os2/b_fsNativeDirRemove.c

    r2929 r3353  
    5151
    5252    /*
    53      * OS/2 returns access denied when the directory
    54      * contains files or it is not a directory. Check for
    55      * directory/other and return failure accordingly.
     53     * - OS/2 returns access denied when the directory contains files
     54     *   or it is not a directory.
     55     * - OS/2 returns path not found when the directory is actually a file.
     56     *
     57     * So, check for directory/other and return failure accordingly.
    5658     */
    57     if (rc == ERROR_ACCESS_DENIED)
     59    if (    rc == ERROR_ACCESS_DENIED
     60        ||  rc == ERROR_PATH_NOT_FOUND)
    5861    {
    5962        struct stat s;
Note: See TracChangeset for help on using the changeset viewer.