FreeCalypso > hg > fc-pcsc-tools
annotate libcommon/localcd.c @ 143:be1a759453ef
simtool code: added elem_select_op() function
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 25 Feb 2021 05:40:19 +0000 |
parents | d991944aa5f3 |
children |
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 } |