summaryrefslogtreecommitdiffstats
path: root/source/web
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
commit1af8bf34f1caa3e7ec312d8109c07d32a945a448 (patch)
tree00f3f2d6778554ba273b73ae82f8790b43e56374 /source/web
parenta7842fac94a3f772da0e6ddf14044df24af798a9 (diff)
downloadsamba-1af8bf34f1caa3e7ec312d8109c07d32a945a448.tar.gz
samba-1af8bf34f1caa3e7ec312d8109c07d32a945a448.tar.xz
samba-1af8bf34f1caa3e7ec312d8109c07d32a945a448.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.
Diffstat (limited to 'source/web')
-rw-r--r--source/web/cgi.c6
-rw-r--r--source/web/swat.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/source/web/cgi.c b/source/web/cgi.c
index 651cd3d8c3e..88f4d3f36fa 100644
--- a/source/web/cgi.c
+++ b/source/web/cgi.c
@@ -149,9 +149,9 @@ void cgi_load_variables(FILE *f1)
len = content_length;
}
} else {
- fseek(f, 0, SEEK_END);
- len = ftell(f);
- fseek(f, 0, SEEK_SET);
+ struct stat st;
+ fstat(fileno(f), &st);
+ len = st.st_size;
}
diff --git a/source/web/swat.c b/source/web/swat.c
index f963c16ccf8..8551c5e907e 100644
--- a/source/web/swat.c
+++ b/source/web/swat.c
@@ -999,7 +999,7 @@ static void printers_page(void)
{
extern char *optarg;
extern int optind;
- extern FILE *dbf;
+ extern XFILE *dbf;
int opt;
char *page;
@@ -1016,8 +1016,8 @@ static void printers_page(void)
/* we don't want any SIGPIPE messages */
BlockSignals(True,SIGPIPE);
- dbf = sys_fopen("/dev/null", "w");
- if (!dbf) dbf = stderr;
+ dbf = x_fopen("/dev/null", O_WRONLY, 0);
+ if (!dbf) dbf = x_stderr;
/* we don't want stderr screwing us up */
close(2);