* of the GNU Lesser General Public License.
*/
-#include "ucw/lib.h"
-#include "ucw/log.h"
-#include "ucw/log-internal.h"
-#include "ucw/io.h"
-#include "ucw/threads.h"
-#include "ucw/simple-lists.h"
+#include <ucw/lib.h>
+#include <ucw/log.h>
+#include <ucw/log-internal.h>
+#include <ucw/io.h>
+#include <ucw/threads.h>
+#include <ucw/simple-lists.h>
#include <stdio.h>
#include <string.h>
struct file_stream {
struct log_stream ls; // ls.name is the current name of the log file
int fd;
- uns flags; // FF_xxx
+ uint flags; // FF_xxx
char *orig_name; // Original name with strftime escapes
};
}
struct log_stream *
-log_new_fd(int fd, uns flags)
+log_new_fd(int fd, uint flags)
{
struct log_stream *ls = log_new_stream(sizeof(struct file_stream));
struct file_stream *fs = (struct file_stream *) ls;
}
struct log_stream *
-log_new_file(const char *path, uns flags)
+log_new_file(const char *path, uint flags)
{
struct log_stream *ls = log_new_stream(sizeof(struct file_stream));
struct file_stream *fs = (struct file_stream *) ls;
fs->fd = -1;
+ fs->flags = FF_CLOSE_FD | flags;
fs->orig_name = xstrdup(path);
if (strchr(path, '%'))
- fs->flags = FF_FORMAT_NAME;
- fs->flags |= FF_CLOSE_FD | flags;
+ fs->flags |= FF_FORMAT_NAME;
ls->msgfmt = LSFMT_DEFAULT;
ls->handler = file_handler;
ls->close = file_close;