annotate libcommon/localcd.c @ 96:a5cfe5135701

simtool: grcard2.c split into grcard2ki.c and grcard2pins.c
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 05 May 2021 03:55:23 +0000
parents c9ef9e91dd8e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module implements the local cd command.
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <stdio.h>
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <stdlib.h>
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <unistd.h>
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 cmd_cd(argc, argv)
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 char **argv;
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 {
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 int rc;
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 rc = chdir(argv[1]);
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 if (rc < 0)
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 perror(argv[1]);
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 return rc;
c9ef9e91dd8e new libcommon, initial version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 }