aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-08-10 08:10:26 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-08-10 08:26:15 +0200
commit6d30a35d2185e05fcade63182240d96c7f7d4a89 (patch)
tree351ecc8c95d9fa286db851089c5914b308baae45 /openbsc/src/vty
parentc423a12392b76e47739491cacca17c3535a8ae4b (diff)
vty: Avoid implicit declaration warning and check result code
Diffstat (limited to 'openbsc/src/vty')
-rw-r--r--openbsc/src/vty/vty.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/openbsc/src/vty/vty.c b/openbsc/src/vty/vty.c
index 6e3134a98..53800d111 100644
--- a/openbsc/src/vty/vty.c
+++ b/openbsc/src/vty/vty.c
@@ -19,6 +19,9 @@
#include <vty/buffer.h>
#include <openbsc/talloc.h>
+/* our callback, located in telnet_interface.c */
+void vty_event(enum event event, int sock, struct vty *vty);
+
extern struct host host;
/* Vector which store each vty structure. */
@@ -1593,13 +1596,15 @@ void vty_reset()
static void vty_save_cwd(void)
{
char cwd[MAXPATHLEN];
- char *c;
+ char *c ;
c = getcwd(cwd, MAXPATHLEN);
if (!c) {
- chdir(SYSCONFDIR);
- getcwd(cwd, MAXPATHLEN);
+ if (chdir(SYSCONFDIR) != 0)
+ perror("chdir failed");
+ if (getcwd(cwd, MAXPATHLEN) == NULL)
+ perror("getcwd failed");
}
vty_cwd = _talloc_zero(tall_vty_ctx, strlen(cwd) + 1, "save_cwd");