diff options
author | ajs <ajs> | 2004-11-20 02:06:59 +0000 |
---|---|---|
committer | ajs <ajs> | 2004-11-20 02:06:59 +0000 |
commit | 6099b3b56956322567323c11fd698b2328c6826b (patch) | |
tree | fa537bd0eaa9f7d824f39445eabc928db59050ca /vtysh/vtysh.c | |
parent | ae5e24d8678f1e3a60dde58d3382c5ba73d6bb27 (diff) |
2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* global: Replace strerror with safe_strerror. And vtysh/vtysh.c
needs to include "log.h" to pick up the declaration.
Diffstat (limited to 'vtysh/vtysh.c')
-rw-r--r-- | vtysh/vtysh.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index c7271ff0..08bd1275 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -33,6 +33,7 @@ #include "command.h" #include "memory.h" #include "vtysh/vtysh.h" +#include "log.h" /* Struct VTY. */ struct vty *vty; @@ -1562,7 +1563,7 @@ int write_config_integrated(void) if (chmod (integrate_default, CONFIGFILE_MASK) != 0) { fprintf (stdout,"%% Can't chmod configuration file %s: %s (%d)\n", - integrate_default, strerror(errno), errno); + integrate_default, safe_strerror(errno), errno); return CMD_WARNING; } @@ -1715,7 +1716,7 @@ execute_command (const char *command, int argc, const char *arg1, if (pid < 0) { /* Failure of fork(). */ - fprintf (stderr, "Can't fork: %s\n", strerror (errno)); + fprintf (stderr, "Can't fork: %s\n", safe_strerror (errno)); exit (1); } else if (pid == 0) @@ -1735,7 +1736,7 @@ execute_command (const char *command, int argc, const char *arg1, } /* When execlp suceed, this part is not executed. */ - fprintf (stderr, "Can't execute %s: %s\n", command, strerror (errno)); + fprintf (stderr, "Can't execute %s: %s\n", command, safe_strerror (errno)); exit (1); } else @@ -1893,7 +1894,7 @@ vtysh_connect (struct vtysh_client *vclient, const char *path) if (ret < 0 && errno != ENOENT) { fprintf (stderr, "vtysh_connect(%s): stat = %s\n", - path, strerror(errno)); + path, safe_strerror(errno)); exit(1); } @@ -1913,7 +1914,7 @@ vtysh_connect (struct vtysh_client *vclient, const char *path) { #ifdef DEBUG fprintf(stderr, "vtysh_connect(%s): socket = %s\n", path, - strerror(errno)); + safe_strerror(errno)); #endif /* DEBUG */ return -1; } @@ -1932,7 +1933,7 @@ vtysh_connect (struct vtysh_client *vclient, const char *path) { #ifdef DEBUG fprintf(stderr, "vtysh_connect(%s): connect = %s\n", path, - strerror(errno)); + safe_strerror(errno)); #endif /* DEBUG */ close (sock); return -1; |