aboutsummaryrefslogtreecommitdiff
blob: 6034be3600c3d37d5ddac959023e50d86d897793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/lib/log/log.c b/lib/log/log.c
index 79fbd7a..0999d10 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -161,6 +161,7 @@ static void _check_and_replace_standard_log_streams(FILE *old_stream, FILE *new_
  * Close and reopen standard stream on file descriptor fd.
  */
 int reopen_standard_stream(FILE **stream, const char *mode)
+#ifdef __GLIBC__
 {
 	int fd, fd_copy, new_fd;
 	const char *name;
@@ -207,6 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
 	*stream = new_stream;
 	return 1;
 }
+#else
+{
+    return (freopen(NULL, mode, *stream) != NULL);
+}
+#endif
 
 void init_log_fn(lvm2_log_fn_t log_fn)
 {