summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-15 07:17:34 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-15 07:17:34 +0000
commit414caf80a2705c5953af03db736a0d9774fab9fc (patch)
treef301034219df36172a6c12f585357d17ce9069bc
parent62a24c4bb39845d2e8a5096e4845148cbd6ae075 (diff)
downloadsamba-414caf80a2705c5953af03db736a0d9774fab9fc.tar.gz
samba-414caf80a2705c5953af03db736a0d9774fab9fc.tar.bz2
samba-414caf80a2705c5953af03db736a0d9774fab9fc.zip
make prs_dump() store up to 100 variants of each msg type
(This used to be commit 0e7819bb4562a840ecb9b7ef12706572b6b60202)
-rw-r--r--source3/rpc_parse/parse_prs.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 2edd080a0e..efcd16470a 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -29,13 +29,20 @@ extern int DEBUGLEVEL;
/*******************************************************************
dump a prs to a file
********************************************************************/
-void prs_dump(char *name, int level, prs_struct *ps)
+void prs_dump(char *name, int v, prs_struct *ps)
{
- int fd;
+ int fd, i;
pstring fname;
if (DEBUGLEVEL < 50) return;
- slprintf(fname,sizeof(fname), "/tmp/%s_%d.prs", name, level);
- fd = open(fname, O_WRONLY|O_CREAT|O_EXCL, 0644);
+ for (i=1;i<100;i++) {
+ if (v != -1) {
+ slprintf(fname,sizeof(fname), "/tmp/%s_%d.%d.prs", name, v, i);
+ } else {
+ slprintf(fname,sizeof(fname), "/tmp/%s.%d.prs", name, i);
+ }
+ fd = open(fname, O_WRONLY|O_CREAT|O_EXCL, 0644);
+ if (fd != -1 || errno != EEXIST) break;
+ }
if (fd != -1) {
write(fd, ps->data_p + ps->data_offset, ps->buffer_size - ps->data_offset);
close(fd);