summaryrefslogtreecommitdiff
path: root/source3/utils/testprns.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/testprns.c')
-rw-r--r--source3/utils/testprns.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/source3/utils/testprns.c b/source3/utils/testprns.c
index 89c615898d..66c8e9bfd6 100644
--- a/source3/utils/testprns.c
+++ b/source3/utils/testprns.c
@@ -1,8 +1,7 @@
/*
- Unix SMB/Netbios implementation.
- Version 1.9.
+ Unix SMB/CIFS implementation.
test printer setup
- Copyright (C) Karl Auer 1993, 1994
+ Copyright (C) Karl Auer 1993, 1994-1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,11 +32,6 @@
#include "includes.h"
#include "smb.h"
-#include "pcap.h"
-
-/* these live in util.c */
-extern FILE *dbf;
-extern int DEBUGLEVEL;
int main(int argc, char *argv[])
{
@@ -45,17 +39,14 @@ int main(int argc, char *argv[])
setup_logging(argv[0],True);
- charset_initialise();
-
if (argc < 2 || argc > 3)
printf("Usage: testprns printername [printcapfile]\n");
else
{
- dbf = fopen("test.log", "w");
- if (dbf == NULL)
+ dbf = x_fopen("test.log", O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ if (dbf == NULL) {
printf("Unable to open logfile.\n");
- else
- {
+ } else {
DEBUGLEVEL = 3;
pszTemp = (argc < 3) ? PRINTCAP_NAME : argv[2];
printf("Looking for printer %s in printcap file %s\n",
@@ -64,9 +55,8 @@ int main(int argc, char *argv[])
printf("Printer name %s is not valid.\n", argv[1]);
else
printf("Printer name %s is valid.\n", argv[1]);
- fclose(dbf);
+ x_fclose(dbf);
}
}
return (0);
}
-