annotate libcommon/localcd.c @ 219:ac41c42ce806

scripts/fcsim1-defprog created
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Mar 2021 20:24:05 +0000
parents d991944aa5f3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
132
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module implements the local cd command.
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <stdio.h>
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <stdlib.h>
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <unistd.h>
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 cmd_cd(argc, argv)
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 char **argv;
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 {
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 int rc;
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 rc = chdir(argv[1]);
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 if (rc < 0)
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 perror(argv[1]);
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 return rc;
d991944aa5f3 fc-simtool: local cd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 }