* smbfs.c (smbfs_set_debugf): New function to specify logfile.

* smbfs.h: Declare smbfs_set_debugf().
This commit is contained in:
Andrew V. Samoilov 2002-09-13 09:46:33 +00:00
parent e7cf7313f8
commit 6a6fb355df
2 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2002-09-13 Andrew V. Samoilov <sav@bcs.zp.ua>
* smbfs.c (smbfs_set_debugf): New function to specify
logfile.
* smbfs.h: Declare smbfs_set_debugf().
2002-09-12 Pavel Roskin <proski@gnu.org>
* mcserv.c: Declare crypt if crypt.h is missing and we are not

View File

@ -20,7 +20,7 @@
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Namespace: exports vfs_smbfs_ops, smbfs_set_debug */
/* Namespace: exports vfs_smbfs_ops, smbfs_set_debug(), smbfs_set_debugf() */
#include <config.h>
#include <stdio.h>
#include <sys/types.h>
@ -250,9 +250,25 @@ bucket_set_authinfo (smbfs_connection *bucket,
}
void
smbfs_set_debug(int arg)
smbfs_set_debug (int arg)
{
DEBUGLEVEL = arg;
DEBUGLEVEL = arg;
}
void
smbfs_set_debugf (const char *filename)
{
extern pstring debugf;
extern FILE *dbf;
if (DEBUGLEVEL > 0) {
FILE *outfile = fopen (filename, "w");
if (outfile) {
setup_logging ("", True); /* No needs for timestamp for each message */
dbf = outfile;
setbuf (dbf, NULL);
pstrcpy (debugf, filename);
}
}
}
/********************** The callbacks ******************************/
@ -263,7 +279,6 @@ smbfs_init (vfs * me)
/* DEBUGLEVEL = 4; */
setup_logging ("mc", True);
TimeInit ();
charset_initialise ();