Changeset d96d9bc in mainline for uspace/app/bdsh/cmds/builtins/cd


Ignore:
Timestamp:
2017-04-02T20:38:50Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c23275a
Parents:
1e2e5795
Message:

Rename chdir() to vfs_cwd_set() and getcwd() to vfs_cwd_get()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtins/cd/cd.c

    r1e2e5795 rd96d9bc  
    2929#include <stdio.h>
    3030#include <stdlib.h>
    31 #include <unistd.h>
    3231#include <str.h>
    3332#include <errno.h>
     33#include <vfs/vfs.h>
    3434
    3535#include "util.h"
     
    5151static bool previous_directory_set = false;
    5252
    53 static int chdir_and_remember(const char *new_dir) {
     53static int chdir_and_remember(const char *new_dir)
     54{
    5455
    55         char *ok = getcwd(previous_directory_tmp, PATH_MAX);
    56         previous_directory_valid = ok != NULL;
     56        int rc = vfs_cwd_get(previous_directory_tmp, PATH_MAX);
     57        previous_directory_valid = (rc == EOK);
    5758        previous_directory_set = true;
    5859
    59         if (chdir(new_dir) != 0)
    60                 return errno;
     60        rc = vfs_cwd_set(new_dir);
     61        if (rc != EOK)
     62                return rc;
    6163
    6264        str_cpy(previous_directory, PATH_MAX, previous_directory_tmp);
Note: See TracChangeset for help on using the changeset viewer.