-#endif
-
-/* destructor for standard files */
-static void ls_fdfile_close(struct log_stream *ls)
-{
- ASSERT(ls);
- close(ls->idata);
- if(ls->name)
- xfree(ls->name);
-}
-
-/* handler for standard files */
-static int ls_fdfile_handler(struct log_stream* ls, const char *m, u32 cat UNUSED)
-{
- int len = strlen(m);
- int r = write(ls->idata, m, len);
- /* TODO: check the errors here? */
- if (r!=len)
- return errno;
- return 0;
-}
-
-/* assign log to a file descriptor */
-/* initialize with the default formatting, does NOT close the descriptor */
-struct log_stream *ls_fdfile_new(int fd)
-{
- struct log_stream *ls=ls_new();
- ls->idata=fd;
- ls->msgfmt=LSFMT_DEFAULT;
- ls->handler=ls_fdfile_handler;
- return ls;
-}
-
-/* open() a file (append mode) */
-/* initialize with the default formatting */
-struct log_stream *ls_file_new(const char *path)