Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
spr0cketeer
Icecast-common
Commits
69739738
Commit
69739738
authored
Aug 06, 2005
by
Karl Heyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
force a large filesize limit on log files before cycling
svn path=/icecast/trunk/log/; revision=9706
parent
050d5b90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
log/log.c
log/log.c
+8
-4
No files found.
log/log.c
View file @
69739738
...
...
@@ -54,8 +54,8 @@ typedef struct log_tag
char
*
filename
;
FILE
*
logfile
;
unsigned
size
;
unsigned
trigger_level
;
off_t
size
;
off_t
trigger_level
;
char
*
buffer
;
}
log_t
;
...
...
@@ -83,11 +83,15 @@ static int _log_open (int id)
if
(
loglist
[
id
]
.
logfile
)
{
char
new_name
[
255
];
char
new_name
[
4096
];
fclose
(
loglist
[
id
]
.
logfile
);
loglist
[
id
]
.
logfile
=
NULL
;
/* simple rename, but could use time providing locking were used */
snprintf
(
new_name
,
sizeof
(
new_name
),
"%s.old"
,
loglist
[
id
]
.
filename
);
#ifdef _WIN32
if
(
stat
(
new_name
,
&
st
)
==
0
)
remove
(
new_name
);
#endif
rename
(
loglist
[
id
]
.
filename
,
new_name
);
}
loglist
[
id
]
.
logfile
=
fopen
(
loglist
[
id
]
.
filename
,
"a"
);
...
...
@@ -115,7 +119,7 @@ void log_initialize()
loglist
[
i
].
in_use
=
0
;
loglist
[
i
].
level
=
2
;
loglist
[
i
].
size
=
0
;
loglist
[
i
].
trigger_level
=
0
;
loglist
[
i
].
trigger_level
=
100000000
0
;
loglist
[
i
].
filename
=
NULL
;
loglist
[
i
].
logfile
=
NULL
;
loglist
[
i
].
buffer
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment