Ejemplo n.º 1
0
void rawlog_save(RAWLOG_REC *rawlog, const char *fname)
{
	char *path, *dir;
	int f;

        dir = g_path_get_dirname(fname);
#ifdef HAVE_CAPSICUM
        capsicum_mkdir_with_parents_wrapper(dir, log_dir_create_mode);
#else
        g_mkdir_with_parents(dir, log_dir_create_mode);
#endif
        g_free(dir);

	path = convert_home(fname);
#ifdef HAVE_CAPSICUM
	f = capsicum_open_wrapper(path, O_WRONLY | O_APPEND | O_CREAT,
				  log_file_create_mode);
#else
	f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
#endif
	g_free(path);

	if (f < 0) {
		g_warning("rawlog open() failed: %s", strerror(errno));
		return;
	}

	rawlog_dump(rawlog, f);
	close(f);
}
Ejemplo n.º 2
0
void rawlog_open(RAWLOG_REC *rawlog, const char *fname)
{
	char *path;

        g_return_if_fail(rawlog != NULL);
	g_return_if_fail(fname != NULL);

	if (rawlog->logging)
		return;

	path = convert_home(fname);
#ifdef HAVE_CAPSICUM
	rawlog->handle = capsicum_open_wrapper(path,
					       O_WRONLY | O_APPEND | O_CREAT,
					       log_file_create_mode);
#else
	rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT,
			      log_file_create_mode);
#endif

	g_free(path);

	if (rawlog->handle == -1) {
		g_warning("rawlog open() failed: %s", strerror(errno));
		return;
	}

	rawlog_dump(rawlog, rawlog->handle);
	rawlog->logging = TRUE;
}
Ejemplo n.º 3
0
void rawlog_save(RAWLOG_REC *rawlog, const char *fname)
{
	char *path;
	int f;

	path = convert_home(fname);
	f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
	g_free(path);

	rawlog_dump(rawlog, f);
	close(f);
}
Ejemplo n.º 4
0
Archivo: rawlog.c Proyecto: Liaf/irssi
void rawlog_save(RAWLOG_REC *rawlog, const char *fname)
{
	char *path, *dir;
	int f;

        dir = g_path_get_dirname(fname);
        mkpath(dir, log_dir_create_mode);
        g_free(dir);

	path = convert_home(fname);
	f = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
	g_free(path);

	rawlog_dump(rawlog, f);
	close(f);
}
Ejemplo n.º 5
0
void rawlog_open(RAWLOG_REC *rawlog, const char *fname)
{
	char *path;

        g_return_if_fail(rawlog != NULL);
	g_return_if_fail(fname != NULL);

	if (rawlog->logging)
		return;

	path = convert_home(fname);
	rawlog->handle = open(path, O_WRONLY | O_APPEND | O_CREAT, log_file_create_mode);
	g_free(path);

	rawlog_dump(rawlog, rawlog->handle);
	rawlog->logging = rawlog->handle != -1;
}