Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8f3d9622
Commit
8f3d9622
authored
Oct 29, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: don't use utils.h
Prefer GLib over utils.h.
parent
cf376b4b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
27 deletions
+17
-27
log.c
src/log.c
+17
-5
utils.c
src/utils.c
+0
-20
utils.h
src/utils.h
+0
-2
No files found.
src/log.c
View file @
8f3d9622
...
...
@@ -17,9 +17,7 @@
*/
#include "log.h"
#include "conf.h"
#include "utils.h"
#include <assert.h>
#include <sys/types.h>
...
...
@@ -27,6 +25,13 @@
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include <glib.h>
#define LOG_DATE_BUF_SIZE 16
#define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1)
...
...
@@ -72,7 +77,14 @@ static void buffer_warning(const char *fmt, va_list args)
}
vsnprintf
(
tmp
,
len
,
fmt
,
args
);
warningBuffer
=
appendToString
(
warningBuffer
,
buffer
);
if
(
warningBuffer
==
NULL
)
warningBuffer
=
g_strdup
(
tmp
);
else
{
tmp
=
g_strconcat
(
warningBuffer
,
tmp
,
NULL
);
g_free
(
warningBuffer
);
warningBuffer
=
tmp
;
}
va_end
(
args
);
}
...
...
@@ -256,7 +268,7 @@ void close_log_files(void)
return
;
assert
(
out_fd
>=
0
);
assert
(
err_fd
>=
0
);
x
close
(
out_fd
);
x
close
(
err_fd
);
close
(
out_fd
);
close
(
err_fd
);
}
src/utils.c
View file @
8f3d9622
...
...
@@ -75,26 +75,6 @@ int ipv6Supported(void)
#endif
}
char
*
appendToString
(
char
*
dest
,
const
char
*
src
)
{
int
destlen
;
int
srclen
=
strlen
(
src
);
if
(
dest
==
NULL
)
{
dest
=
xmalloc
(
srclen
+
1
);
memset
(
dest
,
0
,
srclen
+
1
);
destlen
=
0
;
}
else
{
destlen
=
strlen
(
dest
);
dest
=
xrealloc
(
dest
,
destlen
+
srclen
+
1
);
}
memcpy
(
dest
+
destlen
,
src
,
srclen
);
dest
[
destlen
+
srclen
]
=
'\0'
;
return
dest
;
}
unsigned
long
readLEuint32
(
const
unsigned
char
*
p
)
{
return
((
unsigned
long
)
p
[
0
]
<<
0
)
|
...
...
src/utils.h
View file @
8f3d9622
...
...
@@ -37,8 +37,6 @@ void my_usleep(long usec);
int
ipv6Supported
(
void
);
char
*
appendToString
(
char
*
dest
,
const
char
*
src
);
unsigned
long
readLEuint32
(
const
unsigned
char
*
p
);
/* trivial functions, keep them inlined */
...
...
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