FreeCalypso > hg > fc-pcsc-tools
annotate libcommon/localcd.c @ 220:e07de8a9cedf
fc-simtool grcard2-set-comp128 command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 09 Mar 2021 02:01:27 +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 } |