append writes.
(blessed by jra)
Andrew Bartlett
*
* dbf - Global debug file handle.
* debugf - Debug file name.
- * append_log - If True, then the output file will be opened in append
- * mode.
* DEBUGLEVEL - System-wide debug message limit. Messages with message-
* levels higher than DEBUGLEVEL will not be processed.
*/
XFILE *dbf = NULL;
pstring debugf = "";
-BOOL append_log = False;
BOOL debug_warn_unknown_class = True;
BOOL debug_auto_add_unknown_class = True;
BOOL AllowDebugChange = True;
}
pstrcpy( debugf, fname );
- if (append_log)
- new_dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644);
- else
- new_dbf = x_fopen( debugf, O_WRONLY|O_CREAT|O_TRUNC, 0644 );
+ new_dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644);
if (!new_dbf) {
log_overflow = True;
{
mode_t oldumask = umask( 022 );
- if( append_log )
- dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644 );
- else
- dbf = x_fopen( debugf, O_WRONLY|O_CREAT|O_TRUNC, 0644 );
+ dbf = x_fopen( debugf, O_WRONLY|O_APPEND|O_CREAT, 0644 );
(void)umask( oldumask );
if( dbf )
{
**************************************************************************** */
int main(int argc, const char *argv[])
{
- extern BOOL append_log;
static BOOL opt_interactive = False;
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
{"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon(default)" },
- {"log-append", 'a', POPT_ARG_VAL, &append_log, True, "Append to log file" },
{"interactive", 'i', POPT_ARG_VAL, &opt_interactive, True, "Run interactive (not a daemon)" },
- {"log-overwrite", 'o', POPT_ARG_VAL, &append_log, False, "Overwrite log file, don't append" },
{"hosts", 'H', POPT_ARG_STRING, dyn_LMHOSTSFILE, 'H', "Load a netbios hosts file"},
{"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the specified port" },
{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
int opt;
pstring logfile;
- append_log = True; /* Default, override with '-o' option. */
-
global_nmb_port = NMB_PORT;
global_in_nmbd = True;
extern BOOL AllowDebugChange;
extern pstring global_myname;
extern fstring global_myworkgroup;
- extern BOOL append_log;
pstring logfile;
BOOL interactive = False;
int opt;
fault_setup((void (*)(void *))fault_quit );
- /* Append to log file by default as we are a single process daemon
- program. */
-
- append_log = True;
-
snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
lp_set_logfile(logfile);
static BOOL is_daemon = False;
static BOOL interactive = False;
static char *ports = NULL;
- extern BOOL append_log;
int opt;
poptContext pc;
{ NULL }
};
- append_log = True;
-
#ifdef HAVE_SET_AUTH_PARAMETERS
set_auth_parameters(argc,argv);
#endif
****************************************************************************/
int main(int argc,char *argv[])
{
- extern BOOL append_log;
extern char *optarg;
/* shall I run as a daemon */
BOOL is_daemon = False;
lp_set_logfile(logfile);
break;
- case 'a':
- append_log = True;
- break;
-
case 'i':
interactive = True;
break;
- case 'o':
- append_log = False;
- break;
-
case 'D':
is_daemon = True;
break;
load_case_tables();
- append_log = True;
-
if(!specified_logfile) {
slprintf(logfile, sizeof(logfile)-1, "%s/log.wrepld",
dyn_LOGFILEBASE);