Commit 2189796b authored by Max Kellermann's avatar Max Kellermann

null, fifo: use GLib instead of utils.h

parent 3978b7b1
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#undef G_LOG_DOMAIN #undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "fifo" #define G_LOG_DOMAIN "fifo"
...@@ -43,26 +46,25 @@ static FifoData *newFifoData(void) ...@@ -43,26 +46,25 @@ static FifoData *newFifoData(void)
{ {
FifoData *ret; FifoData *ret;
ret = xmalloc(sizeof(FifoData)); ret = g_new(FifoData, 1);
ret->path = NULL; ret->path = NULL;
ret->input = -1; ret->input = -1;
ret->output = -1; ret->output = -1;
ret->created = 0; ret->created = 0;
ret->timer = NULL; ret->timer = NULL;
return ret; return ret;
} }
static void freeFifoData(FifoData *fd) static void freeFifoData(FifoData *fd)
{ {
if (fd->path) g_free(fd->path);
free(fd->path);
if (fd->timer) if (fd->timer)
timer_free(fd->timer); timer_free(fd->timer);
free(fd); g_free(fd);
} }
static void removeFifo(FifoData *fd) static void removeFifo(FifoData *fd)
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "../output_api.h" #include "../output_api.h"
#include "../timer.h" #include "../timer.h"
#include "../utils.h"
#include <glib.h> #include <glib.h>
...@@ -31,7 +30,7 @@ null_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput, ...@@ -31,7 +30,7 @@ null_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
G_GNUC_UNUSED const struct audio_format *audio_format, G_GNUC_UNUSED const struct audio_format *audio_format,
G_GNUC_UNUSED ConfigParam *param) G_GNUC_UNUSED ConfigParam *param)
{ {
struct null_data *nd = xmalloc(sizeof(*nd)); struct null_data *nd = g_new(struct null_data, 1);
nd->timer = NULL; nd->timer = NULL;
return nd; return nd;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment