/*
- * $Id: afp_config.c,v 1.8 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: afp_config.c,v 1.10 2001-12-15 06:25:44 jmarcus Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
/* STDC check */
#if STDC_HEADERS
if (!(asp = asp_getsession(config->obj.handle, server_children,
config->obj.options.tickleval))) {
- syslog( LOG_ERR, "main: asp_getsession: %m" );
+ syslog( LOG_ERR, "main: asp_getsession: %s", strerror(errno) );
exit( 1 );
}
if (!(dsi = dsi_getsession(config->obj.handle, server_children,
config->obj.options.tickleval))) {
- syslog( LOG_ERR, "main: dsi_getsession: %m" );
+ syslog( LOG_ERR, "main: dsi_getsession: %s", strerror(errno) );
exit( 1 );
}
+ config->obj.handle = dsi;
+
/* we've forked. */
if (dsi->child) {
configfree(configs, config);
return NULL;
if ((atp = atp_open(ATADDR_ANYPORT, &options->ddpaddr)) == NULL) {
- syslog( LOG_ERR, "main: atp_open: %m");
+ syslog( LOG_ERR, "main: atp_open: %s", strerror(errno) );
free(config);
return NULL;
}
if ((asp = asp_init( atp )) == NULL) {
- syslog( LOG_ERR, "main: asp_init: %m" );
+ syslog( LOG_ERR, "main: asp_init: %s", strerror(errno) );
atp_close(atp);
free(config);
return NULL;
#endif /* USE_SRVLOC */
if ((config = (AFPConfig *) calloc(1, sizeof(AFPConfig))) == NULL) {
- syslog( LOG_ERR, "DSIConfigInit: malloc(config): %m" );
+ syslog( LOG_ERR, "DSIConfigInit: malloc(config): %s", strerror(errno) );
return NULL;
}
options->ipaddr, options->port,
options->flags & OPTION_PROXY,
options->server_quantum)) == NULL) {
- syslog( LOG_ERR, "main: dsi_init: %m" );
+ syslog( LOG_ERR, "main: dsi_init: %s", strerror(errno) );
free(config);
return NULL;
}
if ((refcount = (unsigned char *)
calloc(1, sizeof(unsigned char))) == NULL) {
- syslog( LOG_ERR, "AFPConfigInit: calloc(refcount): %m" );
+ syslog( LOG_ERR, "AFPConfigInit: calloc(refcount): %s", strerror(errno) );
return NULL;
}