summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-10 11:08:57 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-10 11:08:57 +0000
commitb30e75692d68233448b3ad3d7ddd4b4ac423d3ab (patch)
treeed752b80838a33953632c7f3ffcaf0a71c47a7f5 /source3/utils
parentba8e3e03432ee7649a3f59ba8b37edbb32c34190 (diff)
downloadsamba-b30e75692d68233448b3ad3d7ddd4b4ac423d3ab.tar.gz
samba-b30e75692d68233448b3ad3d7ddd4b4ac423d3ab.tar.bz2
samba-b30e75692d68233448b3ad3d7ddd4b4ac423d3ab.zip
replaced stdio in many parts of samba with a XFILE. XFILE is a cut-down
replacemnt of stdio that doesn't suffer from the 8-bit filedescriptor limit that we hit with nasty consequences on some systems I would eventually prefer us to have a configure test to see if we need to replace stdio, but for now this code needs to be tested widely so I'm enabling it by default. (This used to be commit 1af8bf34f1caa3e7ec312d8109c07d32a945a448)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcacls.c4
-rw-r--r--source3/utils/smbtree.c4
-rw-r--r--source3/utils/status.c4
-rw-r--r--source3/utils/testparm.c4
-rw-r--r--source3/utils/testprns.c6
5 files changed, 11 insertions, 11 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index b26dbae417..59744a9315 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -802,7 +802,7 @@ You can string acls together with spaces, commas or newlines\n\
pstring filename;
extern char *optarg;
extern int optind;
- extern FILE *dbf;
+ extern XFILE *dbf;
int opt;
char *p;
static pstring servicesf = CONFIGFILE;
@@ -816,7 +816,7 @@ You can string acls together with spaces, commas or newlines\n\
setlinebuf(stdout);
- dbf = stderr;
+ dbf = x_stderr;
if (argc < 3 || argv[1][0] == '-') {
usage();
diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c
index 41940d9a6c..75390965b3 100644
--- a/source3/utils/smbtree.c
+++ b/source3/utils/smbtree.c
@@ -325,7 +325,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
{
extern char *optarg;
extern int optind;
- extern FILE *dbf;
+ extern XFILE *dbf;
int opt;
char *p;
pstring servicesf = CONFIGFILE;
@@ -336,7 +336,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
setlinebuf(stdout);
- dbf = stderr;
+ dbf = x_stderr;
setup_logging(argv[0],True);
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 91eca9f88f..7cbb1850de 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -45,7 +45,7 @@ struct session_record{
} *srecs;
extern int DEBUGLEVEL;
-extern FILE *dbf;
+extern XFILE *dbf;
static pstring Ucrit_username = ""; /* added by OH */
static pid_t Ucrit_pid[100]; /* Ugly !!! */ /* added by OH */
@@ -556,7 +556,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
setup_logging(argv[0],True);
DEBUGLEVEL = 0;
- dbf = stderr;
+ dbf = x_stderr;
if (getuid() != geteuid()) {
d_printf("smbstatus should not be run setuid\n");
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 28870fb272..e430fe414b 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -36,7 +36,7 @@
#include "smb.h"
/* these live in util.c */
-extern FILE *dbf;
+extern XFILE *dbf;
extern int DEBUGLEVEL;
/***********************************************
@@ -210,7 +210,7 @@ int main(int argc, char *argv[])
else if ((argc == 2) || (argc == 4))
pstrcpy(configfile,argv[optind]);
- dbf = stdout;
+ dbf = x_stdout;
DEBUGLEVEL = 2;
printf("Load smb config files from %s\n",configfile);
diff --git a/source3/utils/testprns.c b/source3/utils/testprns.c
index f8fdcd63a1..6a5b35db3b 100644
--- a/source3/utils/testprns.c
+++ b/source3/utils/testprns.c
@@ -35,7 +35,7 @@
#include "smb.h"
/* these live in util.c */
-extern FILE *dbf;
+extern XFILE *dbf;
extern int DEBUGLEVEL;
int main(int argc, char *argv[])
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
printf("Usage: testprns printername [printcapfile]\n");
else
{
- dbf = sys_fopen("test.log", "w");
+ dbf = x_fopen("test.log", O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (dbf == NULL) {
printf("Unable to open logfile.\n");
} else {
@@ -62,7 +62,7 @@ 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);