From 6a6fb355df5af0d44aeea49e5372e823d8ee8114 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Fri, 13 Sep 2002 09:46:33 +0000 Subject: [PATCH] * smbfs.c (smbfs_set_debugf): New function to specify logfile. * smbfs.h: Declare smbfs_set_debugf(). --- vfs/ChangeLog | 6 ++++++ vfs/smbfs.c | 23 +++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 5f06cd358..5994a33d7 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,9 @@ +2002-09-13 Andrew V. Samoilov + + * smbfs.c (smbfs_set_debugf): New function to specify + logfile. + * smbfs.h: Declare smbfs_set_debugf(). + 2002-09-12 Pavel Roskin * mcserv.c: Declare crypt if crypt.h is missing and we are not diff --git a/vfs/smbfs.c b/vfs/smbfs.c index f244a96ef..5da194c4c 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -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 #include #include @@ -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 ();