- Use strerror() instead of sys_errlist[] for increased portability
(Needed for SunOS)
This commit is contained in:
parent
66e535a729
commit
4dde583bc9
4 changed files with 20 additions and 18 deletions
|
@ -19,7 +19,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: conf.c,v 1.9.4.8 2000/08/09 14:02:15 guus Exp $
|
||||
$Id: conf.c,v 1.9.4.9 2000/09/06 11:49:03 guus Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -214,7 +214,7 @@ read_config_file(const char *fname)
|
|||
cp
|
||||
if((fp = fopen (fname, "r")) == NULL)
|
||||
{
|
||||
fprintf(stderr, _("Could not open %s: %s\n"), fname, sys_errlist[errno]);
|
||||
fprintf(stderr, _("Could not open %s: %s\n"), fname, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
20
src/net.c
20
src/net.c
|
@ -17,7 +17,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: net.c,v 1.35.4.26 2000/08/09 14:02:16 guus Exp $
|
||||
$Id: net.c,v 1.35.4.27 2000/09/06 11:49:03 guus Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -934,7 +934,7 @@ cp
|
|||
if(x)
|
||||
{
|
||||
syslog(LOG_ERR, _("Incoming data socket error for %s (%s): %s"),
|
||||
cl->vpn_hostname, cl->real_hostname, sys_errlist[x]);
|
||||
cl->vpn_hostname, cl->real_hostname, strerror(x));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1132,13 +1132,7 @@ cp
|
|||
if(x)
|
||||
{
|
||||
syslog(LOG_ERR, _("Metadata socket error for %s (%s): %s"),
|
||||
cl->vpn_hostname, cl->real_hostname, sys_errlist[x]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(cl->buflen >= MAXBUFSIZE)
|
||||
{
|
||||
syslog(LOG_ERR, _("Metadata read buffer overflow!"));
|
||||
cl->vpn_hostname, cl->real_hostname, strerror(x));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1233,6 +1227,12 @@ cp
|
|||
}
|
||||
}
|
||||
|
||||
if(cl->buflen >= MAXBUFSIZE)
|
||||
{
|
||||
syslog(LOG_ERR, _("Metadata read buffer overflow!"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
cl->last_ping_time = time(NULL);
|
||||
cl->want_ping = 0;
|
||||
cp
|
||||
|
@ -1264,7 +1264,7 @@ cp
|
|||
*/
|
||||
getsockopt(p->socket, SOL_SOCKET, SO_ERROR, &x, &l);
|
||||
syslog(LOG_ERR, _("Outgoing data socket error for %s (%s): %s"),
|
||||
p->vpn_hostname, p->real_hostname, sys_errlist[x]);
|
||||
p->vpn_hostname, p->real_hostname, strerror(x));
|
||||
terminate_connection(p);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: netutl.c,v 1.12.4.7 2000/08/17 16:51:07 guus Exp $
|
||||
$Id: netutl.c,v 1.12.4.8 2000/09/06 11:49:05 guus Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include <utils.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include "errno.h"
|
||||
#include "conf.h"
|
||||
#include "encr.h"
|
||||
#include "net.h"
|
||||
|
@ -217,7 +218,7 @@ cp
|
|||
|
||||
if(!(h = gethostbyname(p)))
|
||||
{
|
||||
fprintf(stderr, _("Error looking up `%s': %s\n"), p, sys_errlist[h_errno]);
|
||||
fprintf(stderr, _("Error looking up `%s': %s\n"), p, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: tincd.c,v 1.10.4.8 2000/08/17 16:51:08 guus Exp $
|
||||
$Id: tincd.c,v 1.10.4.9 2000/09/06 11:49:05 guus Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -30,6 +30,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
|
@ -454,10 +455,10 @@ RETSIGTYPE
|
|||
sighuh(int a)
|
||||
{
|
||||
if(cp_file)
|
||||
syslog(LOG_NOTICE, _("Got unexpected signal %d after %s line %d"),
|
||||
a, cp_file, cp_line);
|
||||
syslog(LOG_NOTICE, _("Got unexpected %s after %s line %d"),
|
||||
strsignal(a), cp_file, cp_line);
|
||||
else
|
||||
syslog(LOG_NOTICE, _("Got unexpected signal %d"), a);
|
||||
syslog(LOG_NOTICE, _("Got unexpected %s"), strsignal(a));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue